Skip to content

Commit

Permalink
[SCons] Check for numpy before deciding to build the Python3 module
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Jul 13, 2016
1 parent e2d7e17 commit bdb088d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,7 @@ if env['python3_package'] in ('y', 'default'):
try:
script = '\n'.join(("from distutils.sysconfig import *",
"import site",
"import numpy",
"print(get_python_version())",
"try:",
" print(site.getusersitepackages())",
Expand All @@ -1086,13 +1087,17 @@ if env['python3_package'] in ('y', 'default'):
info = getCommandOutput(env['python3_cmd'], '-c', script)
(env['python3_version'],
env['python3_usersitepackages']) = info.splitlines()[-2:]
except OSError:
except OSError as err:
if env['VERBOSE']:
print 'Error checking for Python 3:'
print err
info = False

if not info:
if env['python3_package'] == 'default':
print ('INFO: Not building the Python 3 package because the Python '
'3 interpreter %r could not be found.' % env['python3_cmd'])
'3 interpreter %r could not be found or a required dependency '
'(e.g. numpy) was not found.' % env['python3_cmd'])
env['python3_package'] = 'n'
else:
print ('ERROR: Could not execute the Python 3 interpreter %r.' %
Expand Down

0 comments on commit bdb088d

Please sign in to comment.