[SCons] Remove unnecessary check for Python 3 Cython module

We use the Python 2 version of Cython to generate the .cpp file which is
separately compiled for both Python 2 and Python 3.
This commit is contained in:
Ray Speth 2015-06-10 22:56:49 -04:00
parent aa7f5a2728
commit a6b3c23750

View file

@ -946,7 +946,7 @@ if env['python_package'] in ('full','default'):
try:
import Cython
cython_version = LooseVersion(Cython.__version__)
print 'INFO: Found Cython version {0} for Python 2.x.'.format(cython_version)
print 'INFO: Using Cython version {0}.'.format(cython_version)
except ImportError:
cython_version = LooseVersion('0.0.0')
@ -986,7 +986,7 @@ if env['python_package'] in ('full','default'):
env['python_package'] = 'minimal'
else:
env['python_package'] = 'full'
print """INFO: Building the full Python package."""
print """INFO: Building the full Python 2 package."""
try:
import site
@ -1030,16 +1030,10 @@ if env['python3_package'] in ('y', 'default'):
"try:",
" print(site.getusersitepackages())",
"except AttributeError:",
" print(site.USER_SITE)",
"try:",
" import Cython",
" print(Cython.__version__)",
"except ImportError:",
" print('0.0.0')"))
" print(site.USER_SITE)"))
info = getCommandOutput(env['python3_cmd'], '-c', script)
(env['python3_version'],
env['python3_usersitepackages'],
cython_version) = info.splitlines()[-3:]
env['python3_usersitepackages']) = info.splitlines()[-2:]
except OSError:
info = False
@ -1052,16 +1046,8 @@ if env['python3_package'] in ('y', 'default'):
print ('ERROR: Could not execute the Python 3 interpreter %r.' %
env['python3_cmd'])
sys.exit(1)
elif cython_version < cython_min_version:
message = ("Cython package for Python 3 not found or incompatible version: "
"Found {0} but {1} or newer is required.".format(cython_version, cython_min_version))
if env['python3_package'] == 'y':
print("ERROR: " + message)
sys.exit(1)
else:
print ("WARNING: " + message)
else:
print 'INFO: Using Cython version {0} for Python 3.x.'.format(cython_version)
print 'INFO: Building Python package for Python {0}'.format(env['python3_version'])
env['python3_package'] = 'y'