src/eric7/DebugClients/Python/DebugBase.py

branch
eric7
changeset 10275
76a32e9f16b4
parent 10167
0a62a4bf749c
child 10287
0322776373ed
diff -r c6b2a22e2337 -r 76a32e9f16b4 src/eric7/DebugClients/Python/DebugBase.py
--- a/src/eric7/DebugClients/Python/DebugBase.py	Tue Oct 31 09:24:27 2023 +0100
+++ b/src/eric7/DebugClients/Python/DebugBase.py	Thu Nov 02 11:26:51 2023 +0100
@@ -168,16 +168,17 @@
         @param frmnr distance of frame to store locals dictionary to. 0 is
             the current frame (int)
         """
-        cf = self.frameList[frmnr]
+        with contextlib.suppress(IndexError):
+            cf = self.frameList[frmnr]
 
-        with contextlib.suppress(ImportError, AttributeError):
-            if "__pypy__" in sys.builtin_module_names:
-                import __pypy__  # __IGNORE_WARNING_I10__
+            with contextlib.suppress(ImportError, AttributeError):
+                if "__pypy__" in sys.builtin_module_names:
+                    import __pypy__  # __IGNORE_WARNING_I10__
 
-                __pypy__.locals_to_fast(cf)
-                return
+                    __pypy__.locals_to_fast(cf)
+                    return
 
-        ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(cf), ctypes.c_int(0))
+            ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(cf), ctypes.c_int(0))
 
     def step(self, traceMode):
         """

eric ide

mercurial