summaryrefslogtreecommitdiffstats
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-11 21:03:42 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-11 21:03:42 (GMT)
commit627a666db05a0a70ac54fe6456719ee0530b5df7 (patch)
tree7dbd04460e4d144c8e06c1163c75599a17df25e8 /Lib/rlcompleter.py
parentecbbd94e71d5e7dcf68d344f77b7a24331823dfc (diff)
downloadcpython-627a666db05a0a70ac54fe6456719ee0530b5df7.zip
cpython-627a666db05a0a70ac54fe6456719ee0530b5df7.tar.gz
cpython-627a666db05a0a70ac54fe6456719ee0530b5df7.tar.bz2
- #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 a2d5fe6..36965e6 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__')