summaryrefslogtreecommitdiffstats
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r--Lib/rlcompleter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index 6eb77f9..4d11aec 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -33,7 +33,6 @@ used, and this module (and the readline module) are silently inactive.
"""
-import readline
import __builtin__
import __main__
@@ -141,4 +140,9 @@ def get_class_members(klass):
ret = ret + get_class_members(base)
return ret
-readline.set_completer(Completer().complete)
+try:
+ import readline
+except ImportError:
+ pass
+else:
+ readline.set_completer(Completer().complete)