Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 850ef93

Browse filesBrowse files
committed
Remove a reference to Python 2.6.
1 parent 91034ee commit 850ef93
Copy full SHA for 850ef93

File tree

Expand file treeCollapse file tree

1 file changed

+5
-12
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-12
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+5-12Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@
3434

3535
from __future__ import (absolute_import, division, print_function,
3636
unicode_literals)
37-
from contextlib import contextmanager
3837

3938
from matplotlib.externals import six
4039
from matplotlib.externals.six.moves import xrange
4140

41+
from contextlib import contextmanager
42+
import importlib
43+
import io
4244
import os
4345
import sys
44-
import warnings
4546
import time
46-
import io
47+
import warnings
4748

4849
import numpy as np
4950
import matplotlib.cbook as cbook
@@ -65,14 +66,6 @@
6566
from matplotlib.cbook import mplDeprecation, warn_deprecated
6667
import matplotlib.backend_tools as tools
6768

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-
7669
try:
7770
from PIL import Image
7871
_has_pil = True
@@ -135,7 +128,7 @@ def get_registered_canvas_class(format):
135128
return None
136129
backend_class = _default_backends[format]
137130
if cbook.is_string_like(backend_class):
138-
backend_class = import_module(backend_class).FigureCanvas
131+
backend_class = importlib.import_module(backend_class).FigureCanvas
139132
_default_backends[format] = backend_class
140133
return backend_class
141134

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.