ia64/xen-unstable

changeset 17238:4ee7c6a4d193

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@sun.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 11:32:06 2008 +0000 (2008-03-18)
parents d0a538659726
children e678b42c36c4
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Mar 18 11:31:39 2008 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Mar 18 11:32:06 2008 +0000
     1.3 @@ -626,8 +626,11 @@ class Shell(cmd.Cmd):
     1.4  
     1.5      def preloop(self):
     1.6          cmd.Cmd.preloop(self)
     1.7 -        import readline
     1.8 -        readline.set_completer_delims(' ')
     1.9 +        try:
    1.10 +            import readline
    1.11 +            readline.set_completer_delims(' ')
    1.12 +        except ImportError:
    1.13 +            pass
    1.14  
    1.15      def default(self, line):
    1.16          words = shlex.split(line)