From ecf89ee8c2646b98795e24e0c51b6e7fd228dca0 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Thu, 1 Feb 2018 16:25:45 +0000 Subject: [PATCH] Switch to using StrictVersion in wx_compat.py --- lib/matplotlib/backends/wx_compat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/wx_compat.py b/lib/matplotlib/backends/wx_compat.py index 7bd5806519df..c547aa1f0d38 100644 --- a/lib/matplotlib/backends/wx_compat.py +++ b/lib/matplotlib/backends/wx_compat.py @@ -11,7 +11,7 @@ unicode_literals) import six -from distutils.version import LooseVersion +from distutils.version import StrictVersion missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython>=2.9" @@ -24,7 +24,7 @@ raise ImportError(missingwx) # Ensure we have the correct version imported -if LooseVersion(wx.VERSION_STRING) < LooseVersion("2.9"): +if StrictVersion(wx.VERSION_STRING) < StrictVersion("2.9"): raise ImportError(missingwx) if is_phoenix: @@ -152,7 +152,7 @@ def _AddTool(parent, wx_ids, text, bmp, tooltip_text): else: add_tool = parent.DoAddTool - if not is_phoenix or LooseVersion(wx.VERSION_STRING) >= str("4.0.0b2"): + if not is_phoenix or StrictVersion(wx.VERSION_STRING) >= str("4.0.0b2"): # NOTE: when support for Phoenix prior to 4.0.0b2 is dropped then # all that is needed is this clause, and the if and else clause can # be removed.