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

Skip to content

Commit ecf89ee

Browse files
authored
Switch to using StrictVersion in wx_compat.py
1 parent 869c984 commit ecf89ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backends/wx_compat.py

Lines 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)