-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed exception class to be more descriptive for graphviz installation errors #152
Conversation
Thank you for the suggestion. An issue with the selected exception |
Good point! It's been a while since I used Python 2.7. Do you think ImportError would be appropriate in this case then? |
|
It's not an exact match for sure. Perhaps raising another OSError with the specific message would be appropriate then? |
Raising You may want to look at this answer, so that the exact same error be raised, except for a modification to its message. This would allow higher levels (e.g., |
I think that will work great! The approach in that stack overflow answer didn't seem to work across both python 2 and 3, as In python 3 apparently this is automatically turned into |
Merged as edb0720. Thanks for adjusting this change. Regarding the observation that in Python 3 instantiating
In particular,
Also, appending the message at the end of |
pydot raises a generic
Exception
when it can't find graphviz installation binaries, which is not ideal. This pull request changes that to a more descriptive and specific class of exception so that it can be handled properly by other code (see keras-team/keras#6398 for the specific motivation).