Little addition to the debuggers to make them more compatible with PyPy.

Sat, 10 Sep 2016 16:15:54 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 Sep 2016 16:15:54 +0200
changeset 5156
5cb4740bd2a9
parent 5154
0a86d976fef5
child 5158
b85f06f38f21

Little addition to the debuggers to make them more compatible with PyPy.

DebugClients/Python2/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python2/DebugBase.py	Sat Sep 10 12:35:05 2016 +0200
+++ b/DebugClients/Python2/DebugBase.py	Sat Sep 10 16:15:54 2016 +0200
@@ -115,6 +115,15 @@
         while cf is not None and frmnr > 0:
             cf = cf.f_back
             frmnr -= 1
+        
+        try:
+            if "__pypy__" in sys.builtin_module_names:
+                import __pypy__
+                __pypy__.locals_to_fast(cf)
+                return
+        except Exception:
+            pass
+        
         ctypes.pythonapi.PyFrame_LocalsToFast(
             ctypes.py_object(cf),
             ctypes.c_int(0))
--- a/DebugClients/Python3/DebugBase.py	Sat Sep 10 12:35:05 2016 +0200
+++ b/DebugClients/Python3/DebugBase.py	Sat Sep 10 16:15:54 2016 +0200
@@ -116,6 +116,15 @@
         while cf is not None and frmnr > 0:
             cf = cf.f_back
             frmnr -= 1
+        
+        try:
+            if "__pypy__" in sys.builtin_module_names:
+                import __pypy__
+                __pypy__.locals_to_fast(cf)
+                return
+        except Exception:
+            pass
+        
         ctypes.pythonapi.PyFrame_LocalsToFast(
             ctypes.py_object(cf),
             ctypes.c_int(0))

eric ide

mercurial