diff --git a/ptvsd/wrapper.py b/ptvsd/wrapper.py index 61318a921..700c11302 100644 --- a/ptvsd/wrapper.py +++ b/ptvsd/wrapper.py @@ -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.') + return False + @async_handler def on_threads(self, request, args): # TODO: docstring @@ -473,7 +478,7 @@ def on_threads(self, request, args): name = unquote(xthread['name']) except KeyError: name = None - if not (name and (name.startswith('pydevd.') or name.startswith('ptvsd.'))): + if not self.is_debugger_internal_thread(name): threads.append({'id': tid, 'name': name}) self.send_response(request, threads=threads) @@ -728,7 +733,7 @@ def on_pydevd_thread_create(self, seq, args): name = unquote(xml.thread['name']) except KeyError: name = None - if not (name and name.startswith('ptvsd.')): + if not self.is_debugger_internal_thread(name): self.send_event('thread', reason='started', threadId=tid) @pydevd_events.handler(pydevd_comm.CMD_THREAD_KILL)