From 4286138e7b06e5dd2cb1e8ebf12f768d018be3c2 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 6 Mar 2008 07:43:02 +0000 Subject: [PATCH] #2220: handle matching failure more gracefully. --- Lib/rlcompleter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py index dab0cb9eaa3..a2d5fe6a8f0 100644 --- a/Lib/rlcompleter.py +++ b/Lib/rlcompleter.py @@ -125,7 +125,7 @@ class Completer: import re m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text) if not m: - return + return [] expr, attr = m.group(1, 3) object = eval(expr, self.namespace) words = dir(object)