[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xm: allow non-existent readline module



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1205839926 0
# Node ID 4ee7c6a4d193cc540505dee7b8d0e5cf038d60c8
# Parent  d0a5386597266c61a136344e5544e62c204de0d2
xm: allow non-existent readline module

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

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/python/xen/xm/main.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r d0a538659726 -r 4ee7c6a4d193 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Mar 18 11:31:39 2008 +0000
+++ b/tools/python/xen/xm/main.py       Tue Mar 18 11:32:06 2008 +0000
@@ -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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.