Skip to content

Commit

Permalink
Fix determining GSL version with subprocess call to gsl-config on win…
Browse files Browse the repository at this point in the history
…dows (fixes #331) following Henry's suggestion

Co-authored-by: Henry Leung <henryskyleung@gmail.com>
  • Loading branch information
jobovy and henrysky committed Feb 16, 2018
1 parent 7a26480 commit 9fea897
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@
del sys.argv[interppotential_ext_pos]
interppotential_ext= True

#code to check the GSL version
#code to check the GSL version; list cmd w/ shell=True only works on Windows
# (https://docs.python.org/3/library/subprocess.html#converting-argument-sequence)
cmd= ['gsl-config',
'--version']
try:
if sys.version_info < (2,7): #subprocess.check_output does not exist
gsl_version= subprocess.Popen(cmd,
gsl_version= subprocess.Popen(cmd,shell=sys.platform.startswith('win'),
stdout=subprocess.PIPE).communicate()[0]
else:
gsl_version= subprocess.check_output(cmd)
gsl_version= subprocess.check_output(cmd,shell=sys.platform.startswith('win'))
except (OSError,subprocess.CalledProcessError):
gsl_version= ['0','0']
else:
Expand Down

0 comments on commit 9fea897

Please sign in to comment.