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

Sat, 10 Sep 2016 16:29:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 Sep 2016 16:29:20 +0200
branch
6_1_x
changeset 5157
c271375ca534
parent 5155
c343f780dc6d
child 5164
197acc53a662

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

DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugBase.py	Sat Sep 10 12:35:05 2016 +0200
+++ b/DebugClients/Python/DebugBase.py	Sat Sep 10 16:29:20 2016 +0200
@@ -117,6 +117,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:29:20 2016 +0200
@@ -118,6 +118,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