Skip to content

Commit

Permalink
Merge pull request matplotlib#2335 from andreabedini/patch-5
Browse files Browse the repository at this point in the history
make sure we only perform absolute imports on loading a backend
  • Loading branch information
mdboom committed Sep 3, 2013
2 parents 271db8c + 7ebee32 commit d0a0100
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/matplotlib/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ def pylab_setup():
backend_name = 'backend_'+backend
backend_name = backend_name.lower() # until we banish mixed case
backend_name = 'matplotlib.backends.%s'%backend_name.lower()

# the last argument is specifies whether to use absolute or relative
# imports. 0 means only perform absolute imports.
backend_mod = __import__(backend_name,
globals(),locals(),[backend_name])
globals(),locals(),[backend_name],0)

# Things we pull in from all backends
new_figure_manager = backend_mod.new_figure_manager
Expand Down

0 comments on commit d0a0100

Please sign in to comment.