-
Notifications
You must be signed in to change notification settings - Fork 413
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
Error propagating exceptions on-non subclassable types #269
Comments
Interesting, I don't really see a way to work-around this problem cleanly off the top of my head. I have been working on this code recently and as far as I understand the reason we want to inherit from Another way to look at it is that in the following snippet, you don't want that the exception you are catching depends on whether try:
Parallel(n_jobs=n_jobs)(delayed(f)(i) for i in range(10))
except ValueError:
# do something Something that could be done in your case is that try:
Parallel(n_jobs=n_jobs)(delayed(f)(i) for i in range(10))
except ValueError, JoblibException:
# do something Better suggestions welcome ! |
I was using joblib to run 8 optimizations using nlopt in parallel, and got this error:
My understanding is because a bunch of nlopt types are actually all generated using SWIG, and cannot be naturally inherited. Should there be a check before joblib tries creating a nice custom exception that the type can indeed be inherited from?
The text was updated successfully, but these errors were encountered: