File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Original file line number Diff line number Diff line change 34
34
35
35
from __future__ import (absolute_import , division , print_function ,
36
36
unicode_literals )
37
- from contextlib import contextmanager
38
37
39
38
from matplotlib .externals import six
40
39
from matplotlib .externals .six .moves import xrange
41
40
41
+ from contextlib import contextmanager
42
+ import importlib
43
+ import io
42
44
import os
43
45
import sys
44
- import warnings
45
46
import time
46
- import io
47
+ import warnings
47
48
48
49
import numpy as np
49
50
import matplotlib .cbook as cbook
65
66
from matplotlib .cbook import mplDeprecation , warn_deprecated
66
67
import matplotlib .backend_tools as tools
67
68
68
- try :
69
- from importlib import import_module
70
- except :
71
- # simple python 2.6 implementation (no relative imports)
72
- def import_module (name ):
73
- __import__ (name )
74
- return sys .modules [name ]
75
-
76
69
try :
77
70
from PIL import Image
78
71
_has_pil = True
@@ -135,7 +128,7 @@ def get_registered_canvas_class(format):
135
128
return None
136
129
backend_class = _default_backends [format ]
137
130
if cbook .is_string_like (backend_class ):
138
- backend_class = import_module (backend_class ).FigureCanvas
131
+ backend_class = importlib . import_module (backend_class ).FigureCanvas
139
132
_default_backends [format ] = backend_class
140
133
return backend_class
141
134
You can’t perform that action at this time.
0 commit comments