Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6bb5994

Browse files
authored
Merge pull request #10624 from anntzer/py3
Some trivial py3fications.
2 parents a2db882 + 8185d62 commit 6bb5994

11 files changed

+5
-50
lines changed

lib/matplotlib/backends/_gtk3_compat.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
Thus, to force usage of PGI when both bindings are installed, import it first.
1212
"""
1313

14-
from __future__ import (absolute_import, division, print_function,
15-
unicode_literals)
16-
17-
import six
18-
1914
import importlib
2015
import sys
2116

lib/matplotlib/backends/backend_gtk3agg.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
from __future__ import (absolute_import, division, print_function,
2-
unicode_literals)
3-
4-
import six
5-
61
import numpy as np
72
import warnings
83

@@ -11,7 +6,7 @@
116
from .backend_gtk3 import _BackendGTK3
127
from matplotlib import transforms
138

14-
if six.PY3 and not HAS_CAIRO_CFFI:
9+
if not HAS_CAIRO_CFFI:
1510
warnings.warn(
1611
"The Gtk3Agg backend is known to not work on Python 3.x with pycairo. "
1712
"Try installing cairocffi.")

lib/matplotlib/backends/backend_gtk3cairo.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
from __future__ import (absolute_import, division, print_function,
2-
unicode_literals)
3-
4-
import six
5-
61
from . import backend_cairo, backend_gtk3
72
from .backend_cairo import cairo, HAS_CAIRO_CFFI
83
from .backend_gtk3 import _BackendGTK3

lib/matplotlib/backends/backend_qt4.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
from __future__ import (absolute_import, division, print_function,
2-
unicode_literals)
3-
4-
import six
5-
61
from .backend_qt5 import (
72
backend_version, SPECIAL_KEYS, SUPER, ALT, CTRL, SHIFT, MODIFIER_KEYS,
83
cursord, _create_qApp, _BackendQT5, TimerQT, MainWindow, FigureManagerQT,

lib/matplotlib/backends/backend_qt4agg.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
"""
22
Render to qt from agg
33
"""
4-
from __future__ import (absolute_import, division, print_function,
5-
unicode_literals)
6-
7-
import six
84

95
from .backend_qt5agg import (
106
_BackendQT5Agg, FigureCanvasQTAgg, FigureManagerQT, NavigationToolbar2QT)

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
"""
22
Render to qt from agg
33
"""
4-
from __future__ import (absolute_import, division, print_function,
5-
unicode_literals)
6-
7-
import six
84

95
import ctypes
106

@@ -63,7 +59,7 @@ def paintEvent(self, e):
6359
qimage = QtGui.QImage(buf, w, h, QtGui.QImage.Format_ARGB32)
6460
# Adjust the buf reference count to work around a memory leak bug
6561
# in QImage under PySide on Python 3.
66-
if QT_API == 'PySide' and six.PY3:
62+
if QT_API == 'PySide':
6763
ctypes.c_long.from_address(id(buf)).value = 1
6864
if hasattr(qimage, 'setDevicePixelRatio'):
6965
# Not available on Qt4 or some older Qt5.

lib/matplotlib/backends/backend_qt5cairo.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
import six
1+
import ctypes
32

43
from .backend_cairo import cairo, FigureCanvasCairo, RendererCairo
54
from .backend_qt5 import QtCore, QtGui, _BackendQT5, FigureCanvasQT
@@ -32,8 +31,7 @@ def paintEvent(self, event):
3231
QtGui.QImage.Format_ARGB32_Premultiplied)
3332
# Adjust the buf reference count to work around a memory leak bug in
3433
# QImage under PySide on Python 3.
35-
if QT_API == 'PySide' and six.PY3:
36-
import ctypes
34+
if QT_API == 'PySide':
3735
ctypes.c_long.from_address(id(buf)).value = 1
3836
if hasattr(qimage, 'setDevicePixelRatio'):
3937
# Not available on Qt4 or some older Qt5.

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import, division, print_function
2-
31
from .. import cbook
42
from . import tkagg # Paint image to Tk photo blitter extension.
53
from .backend_agg import FigureCanvasAgg

lib/matplotlib/backends/backend_tkcairo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import, division, print_function
2-
31
import sys
42

53
import numpy as np

lib/matplotlib/backends/backend_wxcairo.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
from __future__ import (absolute_import, division, print_function,
2-
unicode_literals)
3-
4-
import six
5-
61
import wx
72

83
from .backend_cairo import cairo, FigureCanvasCairo, RendererCairo

lib/matplotlib/pylab.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,6 @@
212212
213213
214214
"""
215-
from __future__ import (absolute_import, division, print_function,
216-
unicode_literals)
217-
218-
import six
219-
220-
import warnings
221215

222216
from matplotlib.cbook import (
223217
flatten, exception_to_str, silent_list, iterable, dedent)
@@ -265,4 +259,4 @@
265259

266260
# This is needed, or bytes will be numpy.random.bytes from
267261
# "from numpy.random import *" above
268-
bytes = six.moves.builtins.bytes
262+
bytes = __import__("builtins").bytes

0 commit comments

Comments
 (0)