Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Move more code to pydevd #1519

Merged
merged 3 commits into from
Jun 13, 2019
Merged

Move more code to pydevd #1519

merged 3 commits into from
Jun 13, 2019

Conversation

karthiknadig
Copy link
Member

No description provided.

@@ -885,7 +885,7 @@ def _evaluate_response(py_db, request, result, error_message=''):
variables_response = pydevd_base_schema.build_response(request, kwargs={'body':body})
py_db.writer.add_command(NetCommand(CMD_RETURN, 0, variables_response, is_json=True))
else:
body = pydevd_schema.EvaluateResponseBody(result='', variablesReference=0)
body = pydevd_schema.EvaluateResponseBody(result=result, variablesReference=0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, reviewing this now it seems that result can be any Python object if py_db.suspended_frames_manager.get_frame_tracker(thread_id) returns None, in internal_evaluate_expression_json, which is unlikely but not impossible on a racing condition.

So, in that condition, when calling _evaluate_response, the result should be result='' and not the actual result from the evaluation.

i.e.: the line that calls this method after if frame_tracker is None: should be:

_evaluate_response(py_db, request, result='', error_message='Thread id: %s is not current thread id.' % (thread_id,))

@karthiknadig karthiknadig merged commit 59ef763 into microsoft:master Jun 13, 2019
@karthiknadig karthiknadig deleted the newapi branch July 2, 2019 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants