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

Removes ptvsd threads from the threads list. #51

Merged
merged 2 commits into from
Feb 12, 2018

Conversation

karthiknadig
Copy link
Member

Fixes: #27

ptvsd/wrapper.py Outdated
name = unquote(xml.thread['name'])
except KeyError:
name = None
if not (name and name.startswith('ptvsd.')):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also be filtering out pydevd threads here, same as in the other place?

Also, let's refactor the check itself into a function, something like is_debugger_internal_thread.

Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason pydevd threads did not show up here, but you are right. I will refactor this as recommended.

ptvsd/wrapper.py Outdated
@@ -455,6 +455,11 @@ def send_process_event(self, start_method):
}
self.send_event('process', **evt)

def is_debugger_internal_thread(self, thread_name):
if thread_name:
return thread_name.startswith('pydevd.') or thread_name.startswith('ptvsd.')
Copy link
Contributor

Choose a reason for hiding this comment

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

This can all be combined in a single expression:

return thread_name and (thread_name.startswith('pydevd.') or thread_name.startswith('ptvsd.'))

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.

2 participants