Skip to content

Commit

Permalink
Merge pull request #1935 from minrk/pyreadline
Browse files Browse the repository at this point in the history
Add version checking to pyreadline import test, as we depend on specific pyreadline versions.

closes #1572
  • Loading branch information
fperez committed Jun 13, 2012
2 parents a8f8a66 + ee28689 commit fc7b2a4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions setupext/setupext.py
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 fc7b2a4

Please sign in to comment.