From 3be8445a0d5725c822c73a1124ee585f12dee83e Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Tue, 31 Mar 2020 02:43:50 +0100 Subject: [PATCH] Use LooseVersion to work with e.g. 1.6.dev --- benchmarks/polygon.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmarks/polygon.py b/benchmarks/polygon.py index 3e2ebb9..842f75d 100644 --- a/benchmarks/polygon.py +++ b/benchmarks/polygon.py @@ -1,5 +1,5 @@ from __future__ import print_function, division -from distutils.version import LooseVersion, StrictVersion +from distutils.version import LooseVersion from sympy import Rational import sympy from sympy.geometry import (Line, Point, @@ -55,7 +55,7 @@ def time_bench01(self): class PolygonSecondMoment: def setup(self): - if StrictVersion(sympy.__version__) < StrictVersion("1.3.0"): + if LooseVersion(sympy.__version__) < LooseVersion("1.3.0"): raise NotImplementedError def time_bench01(self): "Polygon.second_moment_of_area() for w in range(10)" @@ -63,7 +63,7 @@ def time_bench01(self): class PolygonFirstMoment: def setup(self): - if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"): + if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"): raise NotImplementedError def time_bench01(self): "Polygon.first_moment_of_area for w in range(10)" @@ -71,7 +71,7 @@ def time_bench01(self): class PolygonPolarSecondMoment: def setup(self): - if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"): + if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"): raise NotImplementedError def time_bench01(self): "Polygon.polar_second_moment_of_area for w in range(10)" @@ -79,7 +79,7 @@ def time_bench01(self): class PolygonSectionModulus: def setup(self): - if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"): + if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"): raise NotImplementedError def time_bench01(self): "Polygon.section_modulus for w in range(10)" @@ -87,7 +87,7 @@ def time_bench01(self): class PolygonCutSection: def setup(self): - if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"): + if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"): raise NotImplementedError def time_bench01(self): "Polygon.cut_section for w in range(10)"