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

Skip to content

Commit dab4054

Browse files
committed
Merge pull request matplotlib#1225 from WeatherGod/qt3_deprecation
Added deprecation notices for Qt3-based backends.
2 parents 1478a1b + 88c0c32 commit dab4054

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

doc/api/api_changes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ Changes in 1.2.x
131131
* ``twinx`` and ``twiny`` now returns an instance of SubplotBase if
132132
parent axes is an instance of SubplotBase.
133133

134+
* All Qt3-based backends are now deprecated due to the lack of py3k bindings.
135+
Qt and QtAgg backends will continue to work in v1.2.x for py2.6
136+
and py2.7. It is anticipated that the Qt3 support will be completely
137+
removed for the next release.
138+
134139

135140
Changes in 1.1.x
136141
================

doc/users/whats_new.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ project.
3434
The following GUI backends work under Python 3.x: Gtk3Agg, Gtk3Cairo,
3535
Qt4Agg, TkAgg and MacOSX. The other GUI backends do not yet have
3636
adequate bindings for Python 3.x, but continue to work on Python 2.6
37-
and 2.7. The non-GUI backends, such as PDF, PS and SVG, work on both
37+
and 2.7, particularly the Qt and QtAgg backends (which have been
38+
deprecated). The non-GUI backends, such as PDF, PS and SVG, work on both
3839
Python 2.x and 3.x.
3940

4041
Features that depend on the Python Imaging Library, such as JPEG

lib/matplotlib/backends/backend_qt.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import math
33
import os
44
import sys
5+
import warnings
6+
7+
warnings.warn("QT3-based backends are deprecated and will be removed after"
8+
" the v1.2.x release. Use the equivalent QT4 backend instead.",
9+
DeprecationWarning)
510

611
import matplotlib
712
from matplotlib import verbose
@@ -18,7 +23,9 @@
1823
try:
1924
import qt
2025
except ImportError:
21-
raise ImportError("Qt backend requires pyqt to be installed.")
26+
raise ImportError("Qt backend requires pyqt to be installed."
27+
" NOTE: QT3-based backends will not work in"
28+
" Python 3.")
2229

2330
backend_version = "0.9.1"
2431
def fn_name(): return sys._getframe(1).f_code.co_name

0 commit comments

Comments
 (0)