Skip to content

Loading…

Fix setup.py on python_version 2.x.x+ #80

Merged
merged 1 commit into from

2 participants

@hellais

platform.python_version() may return also a version that is of the form 2.x.x+, when such argument gets passed to StrictVersion it will throw this exception:

  ValueError: invalid version number '2.x.x+'

This bug occurs on ubuntu oneiric (11.10 LTS) that has a python version of 2.7.2+.

@gleicon gleicon merged commit 9971dfd into fiorix:master
@gleicon
Collaborator

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 2 additions and 2 deletions.
  1. +2 −2 setup.py
View
4 setup.py
@@ -19,7 +19,7 @@
import platform
from distutils import log
from distutils.core import setup
-from distutils.version import StrictVersion
+from distutils.version import StrictVersion, LooseVersion
requires = ["twisted"]
@@ -29,7 +29,7 @@
# avoiding installation problems on old RedHat distributions (ex. CentOS 5)
# http://stackoverflow.com/questions/7340784/easy-install-pyopenssl-error
py_version = platform.python_version()
-if StrictVersion(py_version) < StrictVersion('2.6'):
+if LooseVersion(py_version) < StrictVersion('2.6'):
distname, version, _id = platform.dist()
else:
distname, version, _id = platform.linux_distribution()
Something went wrong with that request. Please try again.