From 69623e161b9b9dcbcc38add1ff479dfc1eedaadc 2016-09-18 20:58:18 From: Matthias Bussonnier Date: 2016-09-18 20:58:18 Subject: [PATCH] Backport PR #9936: added namespace condition in IPcompleter added ``` if self.use_main_ns: self.namespace = __main__.__dict__ ``` in IPcompelter.py as suggested by Carreau sir, in #9897 --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 87b13b1..f431146 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1164,6 +1164,9 @@ class IPCompleter(Completer): if cursor_pos is None: cursor_pos = len(line_buffer) if text is None else len(text) + if self.use_main_ns: + self.namespace = __main__.__dict__ + if PY3: base_text = text if not line_buffer else line_buffer[:cursor_pos]