Little fix to 'DebugBase.py'. eric7

Thu, 02 Nov 2023 11:26:51 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 02 Nov 2023 11:26:51 +0100
branch
eric7
changeset 10275
76a32e9f16b4
parent 10274
c6b2a22e2337
child 10276
a9a0cb9c9d0c

Little fix to 'DebugBase.py'.

src/eric7/DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
--- 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