summaryrefslogtreecommitdiffstats
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-04-30 18:14:54 (GMT)
committerGeorg Brandl <georg@python.org>2006-04-30 18:14:54 (GMT)
commit3583cff5a9d55b9c1bc17b5d82670e5e6b0fc10d (patch)
tree69e44c0965203d70cddbba81e87fe5efe14475a9 /Lib/rlcompleter.py
parent208badda275a7aaf722a8db87297637e161fa7aa (diff)
downloadcpython-3583cff5a9d55b9c1bc17b5d82670e5e6b0fc10d.zip
cpython-3583cff5a9d55b9c1bc17b5d82670e5e6b0fc10d.tar.gz
cpython-3583cff5a9d55b9c1bc17b5d82670e5e6b0fc10d.tar.bz2
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
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 1d29167..dab0cb9 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -39,7 +39,6 @@ used, and this module (and the readline module) are silently inactive.
"""
-import readline
import __builtin__
import __main__
@@ -147,4 +146,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)