Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cython to python 2 or 3

  • Loading branch information...
commit e9208e38b191cb62f2b8f3ec44982f617a79a9b9 1 parent ca89fbb
@bmcage authored pplk committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 scikits/odes/_build.py
View
10 scikits/odes/_build.py
@@ -63,7 +63,10 @@ def cython(pyx_files, working_path='', include_dirs=None):
c_file_new = c_file + '.new'
# run cython compiler
- cmd = 'cython -o %s %s' % (c_file_new, pyxfile)
+ if sys.version_info[0] < 3:
+ cmd = 'cython -2 -o %s %s' % (c_file_new, pyxfile)
+ else:
+ cmd = 'cython -3 -o %s %s' % (c_file_new, pyxfile)
if include_dirs:
for dir in include_dirs:
cmd += ' -I ' + dir
@@ -78,7 +81,10 @@ def cython(pyx_files, working_path='', include_dirs=None):
'-o', c_file_new, pyxfile],
shell=True)
else:
- status = subprocess.call(['cython', '-o', c_file_new, pyxfile])
+ if sys.version_info[0] < 3:
+ status = subprocess.call(['cython', '-2', '-o', c_file_new, pyxfile])
+ else:
+ status = subprocess.call(['cython', '-3', '-o', c_file_new, pyxfile])
# if the resulting file is small, cython compilation failed
if status != 0 or os.path.getsize(c_file_new) < 100:
Please sign in to comment.
Something went wrong with that request. Please try again.