Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 782f35d

Browse filesBrowse files
authored
Merge pull request #10362 from BrennanGit/fix-AddTool-for-wxPy4.0.0
MNT: Switch to using StrictVersion in wx_compat.py
2 parents 869c984 + ecf89ee commit 782f35d
Copy full SHA for 782f35d

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎lib/matplotlib/backends/wx_compat.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/wx_compat.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
unicode_literals)
1212

1313
import six
14-
from distutils.version import LooseVersion
14+
from distutils.version import StrictVersion
1515

1616
missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython>=2.9"
1717

@@ -24,7 +24,7 @@
2424
raise ImportError(missingwx)
2525

2626
# Ensure we have the correct version imported
27-
if LooseVersion(wx.VERSION_STRING) < LooseVersion("2.9"):
27+
if StrictVersion(wx.VERSION_STRING) < StrictVersion("2.9"):
2828
raise ImportError(missingwx)
2929

3030
if is_phoenix:
@@ -152,7 +152,7 @@ def _AddTool(parent, wx_ids, text, bmp, tooltip_text):
152152
else:
153153
add_tool = parent.DoAddTool
154154

155-
if not is_phoenix or LooseVersion(wx.VERSION_STRING) >= str("4.0.0b2"):
155+
if not is_phoenix or StrictVersion(wx.VERSION_STRING) >= str("4.0.0b2"):
156156
# NOTE: when support for Phoenix prior to 4.0.0b2 is dropped then
157157
# all that is needed is this clause, and the if and else clause can
158158
# be removed.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.