Skip to content

Commit

Permalink
do not halt and catch fire when run under py2.6
Browse files Browse the repository at this point in the history
When run under python 2.6, the python version test logic would exit with a
non-zero exit status and a minimal python stack trace.

    Traceback (most recent call last):
      File "<string>", line 4, in <module>
    AttributeError: 'tuple' object has no attribute 'major'
  • Loading branch information
jhoblitt committed Sep 30, 2016
1 parent 14122d1 commit 071a797
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/newinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,12 @@ fi

if true; then
# Check the version by running a small Python program (taken from the Python EUPS package)
# XXX should not assume that python is in the default path
PYVEROK=$(python -c 'import sys
minver2=7
minver3=5
vmaj = sys.version_info.major
vmin = sys.version_info.minor
vmaj = sys.version_info[0]
vmin = sys.version_info[1]
if (vmaj == 2 and vmin >= minver2) or (vmaj == 3 and vmin >= minver3):
print(1)
else:
Expand Down

0 comments on commit 071a797

Please sign in to comment.