Skip to contentSkip to conversation

xm: allow non-existent readline module

PATCH In review [email protected] 2 participants 2 messages Mar 11, 2008 – Mar 13, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xm: allow non-existent readline module

# HG changeset patch
# User [email protected]
# Date 1187906168 25200
# Node ID 590f85503ec18fc4579b2951e018123bd2a22fc2 # Parent f48c9e5711b1a198d7507738397489edaf42a594
xm: allow non-existent readline module

Let xm work even if Python doesn't have its readline module installed.

tools/python/xen/xm/main.py +5 -2
@@ -626,8 +626,11 @@ class Shell(cmd.Cmd):
 
     def preloop(self):
         cmd.Cmd.preloop(self)
-        import readline
-        readline.set_completer_delims(' ')
+        try:
+            import readline
+            readline.set_completer_delims(' ')
+        except ImportError:
+            pass
 
     def default(self, line):
         words = shlex.split(line)
#1 lore raw
Quoted 8 lines · On Tue, 11 Mar 2008 [email protected] wrote:

# HG changeset patch
# User [email protected]
# Date 1187906168 25200
# Node ID 590f85503ec18fc4579b2951e018123bd2a22fc2 # Parent f48c9e5711b1a198d7507738397489edaf42a594
xm: allow non-existent readline module

Let xm work even if Python doesn't have its readline module installed.

Is it possible to do the same for a non existing xgettext package ;) Same python directory.

Stefan