changeset 21208:fbe449ca9707

Make readline import best-effort
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Mon, 04 May 2015 12:27:40 +0200
parents 93dc70e47fb0
children bfb6e742ad0a
files mxtool/mx.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Mon May 04 11:20:39 2015 +0200
+++ b/mxtool/mx.py	Mon May 04 12:27:40 2015 +0200
@@ -47,10 +47,13 @@
 from argparse import ArgumentParser, REMAINDER
 from os.path import join, basename, dirname, exists, getmtime, isabs, expandvars, isdir, isfile
 
-# needed to work around https://bugs.python.org/issue1927
-import readline
-#then make pylint happy..
-readline.get_line_buffer()
+try:
+    # needed to work around https://bugs.python.org/issue1927
+    import readline
+    #then make pylint happy..
+    readline.get_line_buffer()
+except ImportError:
+    pass
 
 # Support for Python 2.6
 def check_output(*popenargs, **kwargs):