From 9e43788ca2573bb11442d07c84d862934f6f7109 2024-01-08 13:57:50 From: Matthias Bussonnier Date: 2024-01-08 13:57:50 Subject: [PATCH] Prevent crash on StackData NotOneValueFound. This is a workaround for #13598, It does not fix the root cause, but should prevent IPython crash. Worst case it should just not show the relevant frame --- diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index 27d92dc..0e4a097 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -789,7 +789,20 @@ class FrameInfo: @property def lines(self): - return self._sd.lines + from executing.executing import NotOneValueFound + + try: + return self._sd.lines + except NotOneValueFound: + + class Dummy: + lineno = 0 + is_current = False + + def render(self, *, pygmented): + return "" + + return [Dummy()] @property def executing(self):