Skip to content

Commit 3ed2d89

Browse files
Josverlandrewleech
authored andcommitted
debugpy: Improve variable retrievals.
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
1 parent 9adb886 commit 3ed2d89

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

python-ecosys/debugpy/debugpy/server/debug_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ def _handle_evaluate(self, seq, args):
328328
expression = args.get("expression", "")
329329
frame_id = args.get("frameId")
330330
context = args.get("context", "watch")
331-
331+
if not expression:
332+
self.channel.send_response(CMD_EVALUATE, seq, success=False,
333+
message="No expression provided")
334+
return
332335
try:
333336
result = self.pdb.evaluate_expression(expression, frame_id)
334337
self.channel.send_response(CMD_EVALUATE, seq, body={

python-ecosys/debugpy/debugpy/server/pdb_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def get_variables(self, variables_ref):
235235
continue
236236

237237
try:
238-
value_str = str(value)
238+
value_str = repr(value)
239239
type_str = type(value).__name__
240240

241241
variables.append({

0 commit comments

Comments
 (0)