eric6/DebugClients/Python/FlexCompleter.py

branch
maintenance
changeset 7642
72721823d453
parent 7639
422fd05e9c91
child 7960
e8fc383322f7
--- a/eric6/DebugClients/Python/FlexCompleter.py	Sun May 31 17:26:46 2020 +0200
+++ b/eric6/DebugClients/Python/FlexCompleter.py	Sat Jul 04 11:45:34 2020 +0200
@@ -48,11 +48,7 @@
     </ul>
 """
 
-try:
-    import __builtin__ as builtins
-except ImportError:
-    import builtins
-
+import builtins
 import __main__
 
 __all__ = ["Completer"]
@@ -151,7 +147,7 @@
                                   'else'}:
                     word = word + ' '
                 matches.append(word)
-        for nspace in [builtins.__dict__, self.namespace]:
+        for nspace in [self.namespace, builtins.__dict__]:
             for word, val in nspace.items():
                 if word[:n] == text and word not in seen:
                     seen.add(word)
@@ -180,7 +176,7 @@
             return []
         expr, attr = m.group(1, 3)
         try:
-            thisobject = eval(expr, self.namespace)
+            thisobject = eval(expr, self.namespace)     # secok
         except Exception:
             return []
 
@@ -206,7 +202,7 @@
                     match = "{0}.{1}".format(expr, word)
                     try:
                         val = getattr(thisobject, word)
-                    except Exception:
+                    except Exception:       # secok
                         pass  # Include even if attribute not set
                     else:
                         match = self._callable_postfix(val, match)
@@ -235,4 +231,4 @@
     return ret
 
 #
-# eflag: noqa = M702, M111
+# eflag: noqa = M111

eric ide

mercurial