From 4f30e37f226617e9d9c88321be16694dafc9dce1 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Wed, 10 Feb 2016 09:00:05 +0000 Subject: [PATCH] ipython: switched to using LooseVersion for version checks. This is a fix for https://github.com/ARM-software/workload-automation/issues/97 IPython can use rc tags in its version strings, which StrictVersion can't handle. --- wlauto/utils/ipython.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wlauto/utils/ipython.py b/wlauto/utils/ipython.py index dc0b5b97..c1439f40 100644 --- a/wlauto/utils/ipython.py +++ b/wlauto/utils/ipython.py @@ -16,7 +16,7 @@ import os import subprocess -from distutils.version import StrictVersion +from distutils.version import LooseVersion # pylint: disable=wrong-import-position,ungrouped-imports import_error_str = '' @@ -36,7 +36,7 @@ NBFORMAT_VERSION = 3 if IPython: - if StrictVersion('5.0.0') > StrictVersion(IPython.__version__) >= StrictVersion('4.0.0'): + if LooseVersion('5.0.0') > LooseVersion(IPython.__version__) >= LooseVersion('4.0.0'): import nbformat from jupyter_client.manager import KernelManager @@ -51,7 +51,7 @@ if IPython: IPYTHON_NBCONVERT_HTML = ['jupyter', 'nbconvert', '--to html'] IPYTHON_NBCONVERT_PDF = ['jupyter', 'nbconvert', '--to pdf'] - elif StrictVersion('4.0.0') > StrictVersion(IPython.__version__) >= StrictVersion('3.0.0'): + elif LooseVersion('4.0.0') > LooseVersion(IPython.__version__) >= LooseVersion('3.0.0'): from IPython.kernel import KernelManager import IPython.nbformat @@ -65,7 +65,7 @@ if IPython: IPYTHON_NBCONVERT_HTML = ['ipython', 'nbconvert', '--to=html'] IPYTHON_NBCONVERT_PDF = ['ipython', 'nbconvert', '--to=pdf'] - elif StrictVersion('3.0.0') > StrictVersion(IPython.__version__) >= StrictVersion('2.0.0'): + elif LooseVersion('3.0.0') > LooseVersion(IPython.__version__) >= LooseVersion('2.0.0'): from IPython.kernel import KernelManager import IPython.nbformat.v3