Skip to content

Commit

Permalink
Remove a reference to Python 2.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Jun 17, 2016
1 parent 91034ee commit 850ef93
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@

from __future__ import (absolute_import, division, print_function,
unicode_literals)
from contextlib import contextmanager

from matplotlib.externals import six
from matplotlib.externals.six.moves import xrange

from contextlib import contextmanager
import importlib
import io
import os
import sys
import warnings
import time
import io
import warnings

import numpy as np
import matplotlib.cbook as cbook
Expand All @@ -65,14 +66,6 @@
from matplotlib.cbook import mplDeprecation, warn_deprecated
import matplotlib.backend_tools as tools

try:
from importlib import import_module
except:
# simple python 2.6 implementation (no relative imports)
def import_module(name):
__import__(name)
return sys.modules[name]

try:
from PIL import Image
_has_pil = True
Expand Down Expand Up @@ -135,7 +128,7 @@ def get_registered_canvas_class(format):
return None
backend_class = _default_backends[format]
if cbook.is_string_like(backend_class):
backend_class = import_module(backend_class).FigureCanvas
backend_class = importlib.import_module(backend_class).FigureCanvas
_default_backends[format] = backend_class
return backend_class

Expand Down

0 comments on commit 850ef93

Please sign in to comment.