Skip to content

Commit dc865b8

Browse files
committed
remove ipykernel stack frame filtering from stackTrace response
1 parent fa1bd64 commit dc865b8

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

ipykernel/debugger.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -509,23 +509,6 @@ async def source(self, message):
509509
async def stackTrace(self, message):
510510
"""Handle a stack trace message."""
511511
reply = await self._forward_message(message)
512-
# The stackFrames array can have the following content:
513-
# { frames from the notebook}
514-
# ...
515-
# { 'id': xxx, 'name': '<module>', ... } <= this is the first frame of the code from the notebook
516-
# { frames from ipykernel }
517-
# ...
518-
# {'id': yyy, 'name': '<module>', ... } <= this is the first frame of ipykernel code
519-
# or only the frames from the notebook.
520-
# We want to remove all the frames from ipykernel when they are present.
521-
try:
522-
sf_list = reply["body"]["stackFrames"]
523-
module_idx = len(sf_list) - next(
524-
i for i, v in enumerate(reversed(sf_list), 1) if v["name"] == "<module>" and i != 1
525-
)
526-
reply["body"]["stackFrames"] = reply["body"]["stackFrames"][: module_idx + 1]
527-
except StopIteration:
528-
pass
529512
return reply
530513

531514
def accept_variable(self, variable_name):

0 commit comments

Comments
 (0)