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

Skip to content

Some trivial py3fications. #10624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/_gtk3_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
Thus, to force usage of PGI when both bindings are installed, import it first.
"""

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

import six

import importlib
import sys

Expand Down
7 changes: 1 addition & 6 deletions lib/matplotlib/backends/backend_gtk3agg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

import numpy as np
import warnings

Expand All @@ -11,7 +6,7 @@
from .backend_gtk3 import _BackendGTK3
from matplotlib import transforms

if six.PY3 and not HAS_CAIRO_CFFI:
if not HAS_CAIRO_CFFI:
warnings.warn(
"The Gtk3Agg backend is known to not work on Python 3.x with pycairo. "
"Try installing cairocffi.")
Expand Down
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/backend_gtk3cairo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

from . import backend_cairo, backend_gtk3
from .backend_cairo import cairo, HAS_CAIRO_CFFI
from .backend_gtk3 import _BackendGTK3
Expand Down
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/backend_qt4.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

from .backend_qt5 import (
backend_version, SPECIAL_KEYS, SUPER, ALT, CTRL, SHIFT, MODIFIER_KEYS,
cursord, _create_qApp, _BackendQT5, TimerQT, MainWindow, FigureManagerQT,
Expand Down
4 changes: 0 additions & 4 deletions lib/matplotlib/backends/backend_qt4agg.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
"""
Render to qt from agg
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

from .backend_qt5agg import (
_BackendQT5Agg, FigureCanvasQTAgg, FigureManagerQT, NavigationToolbar2QT)
Expand Down
6 changes: 1 addition & 5 deletions lib/matplotlib/backends/backend_qt5agg.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
"""
Render to qt from agg
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

import ctypes

Expand Down Expand Up @@ -63,7 +59,7 @@ def paintEvent(self, e):
qimage = QtGui.QImage(buf, w, h, QtGui.QImage.Format_ARGB32)
# Adjust the buf reference count to work around a memory leak bug
# in QImage under PySide on Python 3.
if QT_API == 'PySide' and six.PY3:
if QT_API == 'PySide':
ctypes.c_long.from_address(id(buf)).value = 1
if hasattr(qimage, 'setDevicePixelRatio'):
# Not available on Qt4 or some older Qt5.
Expand Down
6 changes: 2 additions & 4 deletions lib/matplotlib/backends/backend_qt5cairo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import six
import ctypes

from .backend_cairo import cairo, FigureCanvasCairo, RendererCairo
from .backend_qt5 import QtCore, QtGui, _BackendQT5, FigureCanvasQT
Expand Down Expand Up @@ -32,8 +31,7 @@ def paintEvent(self, event):
QtGui.QImage.Format_ARGB32_Premultiplied)
# Adjust the buf reference count to work around a memory leak bug in
# QImage under PySide on Python 3.
if QT_API == 'PySide' and six.PY3:
import ctypes
if QT_API == 'PySide':
ctypes.c_long.from_address(id(buf)).value = 1
if hasattr(qimage, 'setDevicePixelRatio'):
# Not available on Qt4 or some older Qt5.
Expand Down
2 changes: 0 additions & 2 deletions lib/matplotlib/backends/backend_tkagg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

from .. import cbook
from . import tkagg # Paint image to Tk photo blitter extension.
from .backend_agg import FigureCanvasAgg
Expand Down
2 changes: 0 additions & 2 deletions lib/matplotlib/backends/backend_tkcairo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function

import sys

import numpy as np
Expand Down
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/backend_wxcairo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

import wx

from .backend_cairo import cairo, FigureCanvasCairo, RendererCairo
Expand Down
8 changes: 1 addition & 7 deletions lib/matplotlib/pylab.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@


"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

import warnings

from matplotlib.cbook import (
flatten, exception_to_str, silent_list, iterable, dedent)
Expand Down Expand Up @@ -265,4 +259,4 @@

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