Skip to content

Commit

Permalink
python: Fix version detection
Browse files Browse the repository at this point in the history
python: Use list comprehension so setup.py runs on python3 - fixes #429

Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
  • Loading branch information
piedar committed Jan 7, 2015
1 parent e551c9a commit d8729aa
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wrappers/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ def get_cython_version():
ImportError: Can't load cython or find version
"""
import Cython.Compiler.Main
match = re.search('^([0-9]+)\.([0-9]+)',
Cython.Compiler.Main.Version.version)

try:
# old way, fails for me
version = Cython.Compiler.Main.Version.version
except AttributeError:
version = Cython.Compiler.Main.version

match = re.search('^([0-9]+)\.([0-9]+)', version)
try:
return map(int, match.groups())
return [int(g) for g in match.groups()]
except AttributeError:
raise ImportError

Expand Down

0 comments on commit d8729aa

Please sign in to comment.