From 09994903225d7cfd22f10a7847d0de21901ad5c5 2017-05-11 18:56:41 From: sagnak Date: 2017-05-11 18:56:41 Subject: [PATCH] change regex fullmatch to match for <3.3 compatibility --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 459210c..092008f 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -657,11 +657,11 @@ class Completer(Configurable): if word[:n] == text and word != "__builtins__": match_append(word) - snake_case_re = re.compile(r"[^_]+(_[^_]+)+?") + snake_case_re = re.compile(r"[^_]+(_[^_]+)+?\Z") for lst in [self.namespace.keys(), self.global_namespace.keys()]: shortened = {"_".join([sub[0] for sub in word.split('_')]) : word - for word in lst if snake_case_re.fullmatch(word)} + for word in lst if snake_case_re.match(word)} for word in shortened.keys(): if word[:n] == text and word != "__builtins__": match_append(shortened[word])