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

Skip to content

Commit 4f09f70

Browse files
committed
Raise minimum WX version to 2.9.
2.9 was released in 2010; in fact, *before* 2.8.12 (the previous min version), see https://github.com/wxWidgets/wxPython/releases?after=wxPy-2.9.2.1 Remove some conditional code.
1 parent 39694f2 commit 4f09f70

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

INSTALL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ optional Matplotlib backends and the capabilities they provide.
198198
`PySide <https://pypi.python.org/pypi/PySide>`_: for the Qt4Agg backend;
199199
* `PyQt5 <https://pypi.python.org/pypi/PyQt5>`_: for the Qt5Agg backend;
200200
* :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend;
201-
* :term:`wxpython` (>= 2.8 or later): for the WX or WXAgg backend;
201+
* :term:`wxpython` (>= 2.9 or later): for the WX or WXAgg backend;
202202
* `pycairo <https://pypi.python.org/pypi/pycairo>`_: for GTK3Cairo;
203203
* `Tornado <https://pypi.python.org/pypi/tornado>`_: for the WebAgg backend.
204204

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class ToolBar(object):
351351
class Frame(object):
352352
pass
353353

354-
VERSION_STRING = '2.8.12'
354+
VERSION_STRING = '2.9'
355355

356356

357357
class MyPyQt4(MagicMock):

lib/matplotlib/backends/backend_wx.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,8 @@ def do_nothing(*args, **kwargs):
684684
self.Bind(wx.EVT_MOUSE_CAPTURE_CHANGED, self._onCaptureLost)
685685
self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self._onCaptureLost)
686686

687-
if wx.VERSION_STRING < "2.9":
688-
# only needed in 2.8 to reduce flicker
689-
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
690-
self.Bind(wx.EVT_ERASE_BACKGROUND, self._onEraseBackground)
691-
else:
692-
# this does the same in 2.9+
693-
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
687+
# Reduce flicker.
688+
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
694689

695690
self.macros = {} # dict from wx id to seq of macros
696691

lib/matplotlib/backends/wx_compat.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import six
1414
from distutils.version import LooseVersion
1515

16-
missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12"
16+
missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython>=2.9"
1717

1818

1919
try:
@@ -24,8 +24,7 @@
2424
raise ImportError(missingwx)
2525

2626
# Ensure we have the correct version imported
27-
if LooseVersion(wx.VERSION_STRING) < LooseVersion("2.8.12"):
28-
print(" wxPython version %s was imported." % backend_version)
27+
if LooseVersion(wx.VERSION_STRING) < LooseVersion("2.9"):
2928
raise ImportError(missingwx)
3029

3130
if is_phoenix:

setupext.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ def check_requirements(self):
18071807
_wx_ensure_failed = wxversion.VersionError
18081808

18091809
try:
1810-
wxversion.ensureMinimal('2.8')
1810+
wxversion.ensureMinimal('2.9')
18111811
except _wx_ensure_failed:
18121812
pass
18131813

@@ -1817,13 +1817,9 @@ def check_requirements(self):
18171817
except ImportError:
18181818
raise CheckFailed("requires wxPython")
18191819

1820-
# Extra version check in case wxversion lacks AlreadyImportedError;
1821-
# then VersionError might have been raised and ignored when
1822-
# there really *is* a problem with the version.
1823-
major, minor = [int(n) for n in backend_version.split('.')[:2]]
1824-
if major < 2 or (major < 3 and minor < 8):
1820+
if not is_min_version(backend_version, "2.9"):
18251821
raise CheckFailed(
1826-
"Requires wxPython 2.8, found %s" % backend_version)
1822+
"Requires wxPython 2.9, found %s" % backend_version)
18271823

18281824
return "version %s" % backend_version
18291825

0 commit comments

Comments
 (0)