-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
make sure we only perform absolute imports on loading a backend #2335
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
Conversation
Travis build failure is unrelated. |
@@ -22,7 +22,7 @@ def pylab_setup(): | |||
backend_name = backend_name.lower() # until we banish mixed case | |||
backend_name = 'matplotlib.backends.%s'%backend_name.lower() | |||
backend_mod = __import__(backend_name, | |||
globals(),locals(),[backend_name]) | |||
globals(),locals(),[backend_name],0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment explaining the reason for explicitly setting the import to be absolute. Also, I want to make sure that ipython and spyder does not break with this. Then, I want to get this patch merged asap to let it bake and hopefully we can catch anybody else that was depending on relative imports (can't imagine how, but just to be safe).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, from line 23 it's clear that backend_name is an absolute module name. the difference relies on how user provided strings are understood. I'll see if I can add a note where this is documented.
The documentation says |
Yeah -- I think absolute has certainly always been the intent, even if not the effect of the code. |
Certainly... I just want a comment (or something) right there above it to explain the "0" parameter being passed to the Maybe it is just me being nuts... |
No, you're being perfectly reasonable. I'll write something in.
— On Tue, Aug 27, 2013 at 11:52 PM, Benjamin Root notifications@github.com
|
make sure we only perform absolute imports on loading a backend
make sure we only perform absolute imports on loading a backend
Fixes #2309