summaryrefslogtreecommitdiff
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-11 21:03:42 +0000
committerGeorg Brandl <georg@python.org>2008-05-11 21:03:42 +0000
commit6551feeb1f714f060040123a686f8547c586bc6f (patch)
tree605f1c6ae2a892e965978d7516bcf2743651a65d /Lib/rlcompleter.py
parent8984634109530c741f0443e2df5f276d11330b0c (diff)
downloadcpython-6551feeb1f714f060040123a686f8547c586bc6f.tar.gz
- #2250: Exceptions raised during evaluation of names in rlcompleter's
``Completer.complete()`` method are now caught and ignored.
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r--Lib/rlcompleter.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index a2d5fe6a8f..36965e6eec 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -127,7 +127,10 @@ class Completer:
if not m:
return []
expr, attr = m.group(1, 3)
- object = eval(expr, self.namespace)
+ try:
+ object = eval(expr, self.namespace)
+ except Exception:
+ return []
words = dir(object)
if hasattr(object,'__class__'):
words.append('__class__')