diff --git a/wrappers/python/setup.py b/wrappers/python/setup.py index 40a0f93c..005d4da5 100755 --- a/wrappers/python/setup.py +++ b/wrappers/python/setup.py @@ -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