Skip to content

Commit

Permalink
add version checking to pyreadline import test
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Jun 13, 2012
1 parent 97cd3ce commit 7757e38
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions setupext/setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,22 @@ def check_for_pyzmq():
return True

def check_for_readline():
from distutils.version import LooseVersion
try:
import readline
except ImportError:
try:
import pyreadline
except ImportError:
vs = pyreadline.release.version
except (ImportError, AttributeError):
print_status('readline', "no (required for good interactive behavior)")
return False
else:
print_status('readline', "yes pyreadline-"+pyreadline.release.version)
if LooseVersion(vs).version >= [1,7,1]:
print_status('readline', "yes pyreadline-" + vs)
return True
else:
print_status('readline', "no pyreadline-%s < 1.7.1" % vs)
return False
else:
print_status('readline', "yes")
return True

0 comments on commit 7757e38

Please sign in to comment.