Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

There is no need to split the relevant code into a third-party website, 
especially when it is so small and can be included in-line here.


Python 2.7:

py> import distutils.version
py> distutils.version.LooseVersion('7') > distutils.version.LooseVersion('XP')
False




Python 3.6:

py> import distutils.version
py> distutils.version.LooseVersion('7') > distutils.version.LooseVersion('XP')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/storage/python/Python-3.6.4/Lib/distutils/version.py", line 64, in 
__gt__
    c = self._cmp(other)
  File "/storage/python/Python-3.6.4/Lib/distutils/version.py", line 337, in 
_cmp
    if self.version < other.version:
TypeError: '<' not supported between instances of 'int' and 'str'



(By the way, you appear to have a bug in your sys.excepthook handler. At least 
I can't reproduce the ModuleNotFoundError you are getting.)

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35129>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to