Fix for KeyError in suspended event handle during attach (#507)

* Fix for KeyError in suspended event handle during attach

* Fix typo

* Address comments.
This commit is contained in:
Karthik Nadig 2018-06-20 13:35:34 -07:00 committed by GitHub
parent 33f49c3778
commit e69d534dae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2181,7 +2181,12 @@ class VSCodeMessageProcessor(VSCLifecycleMsgProcessor):
self.pydevd_notify(pydevd_comm.CMD_THREAD_RUN, pyd_tid)
return
vsc_tid = self.thread_map.to_vscode(pyd_tid, autogen=False)
# NOTE: We should add the thread to VSC thread map only if the
# thread is seen here for the first time in 'attach' scenario.
# If we are here in 'launch' scenario and we get KeyError then
# there is an issue in reporting of thread creation.
autogen = self.start_reason == 'attach'
vsc_tid = self.thread_map.to_vscode(pyd_tid, autogen=autogen)
with self.stack_traces_lock:
self.stack_traces[pyd_tid] = xml.thread.frame