Skip to content

Commit a2ac60e

Browse files
committed
Fix richInspectVariables
1 parent 3f9ed67 commit a2ac60e

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

ipykernel/debugger.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -577,29 +577,10 @@ async def richInspectVariables(self, message):
577577

578578
repr_data = {}
579579
repr_metadata = {}
580-
if not self.stopped_threads:
581-
# The code did not hit a breakpoint, we use the intepreter
582-
# to get the rich representation of the variable
583-
result = get_ipython().user_expressions({var_name: var_name})[var_name]
584-
if result.get("status", "error") == "ok":
585-
repr_data = result.get("data", {})
586-
repr_metadata = result.get("metadata", {})
587-
else:
588-
# The code has stopped on a breakpoint, we use the setExpression
589-
# request to get the rich representation of the variable
590-
code = f"get_ipython().display_formatter.format({var_name})"
591-
frame_id = message["arguments"]["frameId"]
592-
seq = message["seq"]
593-
reply = await self._forward_message(
594-
{
595-
"type": "request",
596-
"command": "evaluate",
597-
"seq": seq + 1,
598-
"arguments": {"expression": code, "frameId": frame_id},
599-
}
600-
)
601-
if reply["success"]:
602-
repr_data, repr_metadata = eval(reply["body"]["result"], {}, {})
580+
result = get_ipython().user_expressions({var_name: var_name})[var_name]
581+
if result.get("status", "error") == "ok":
582+
repr_data = result.get("data", {})
583+
repr_metadata = result.get("metadata", {})
603584

604585
body = {
605586
"data": repr_data,

0 commit comments

Comments
 (0)