src/eric7/DebugClients/Python/FlexCompleter.py

branch
eric7
changeset 11047
783fc3de315e
parent 10417
c6011e501282
child 11066
d71eab9be477
diff -r 478b4ce023dd -r 783fc3de315e src/eric7/DebugClients/Python/FlexCompleter.py
--- a/src/eric7/DebugClients/Python/FlexCompleter.py	Sat Nov 09 17:23:04 2024 +0100
+++ b/src/eric7/DebugClients/Python/FlexCompleter.py	Sun Nov 10 15:21:04 2024 +0100
@@ -51,6 +51,7 @@
 import builtins
 import keyword
 import re
+import sys
 
 import __main__
 
@@ -82,8 +83,8 @@
         @exception TypeError raised to indicate a wrong data structure of
             the namespace object
         """
-        if namespace and not isinstance(namespace, dict):
-            raise TypeError("namespace must be a dictionary")
+        if namespace and not isinstance(namespace, (dict, sys._getframe().f_locals.__class__)):
+            raise TypeError("namespace must be a dictionary or since 3.13 a FrameLocalsProxy")
 
         # Don't bind to namespace quite yet, but flag whether the user wants a
         # specific namespace or to use __main__.__dict__. This will allow us
@@ -202,7 +203,7 @@
         words = set(dir(thisobject))
         words.discard("__builtins__")
 
-        if hasattr(object, "__class__"):
+        if hasattr(thisobject, "__class__"):
             words.add("__class__")
             words.update(get_class_members(thisobject.__class__))
         matches = []

eric ide

mercurial