Check if thread should not be traced before logging traced debugger thread warning

It's important to check the `pydev_do_not_trace` attribute before printing the warning because sometimes `run()` method's code is called in the same thread, e.g. in the `Dispatcher` class. The absence of this check leads to a confusing false-positive warning.

GitOrigin-RevId: 62514d5cb99f0181631366d68fe914220fb168d7
This commit is contained in:
Andrey Lisin
2020-11-02 10:44:07 +00:00
committed by intellij-monorepo-bot
parent 4282d60421
commit b7eadf86e1
2 changed files with 2 additions and 2 deletions
@@ -235,7 +235,7 @@ class PyDBDaemonThread(threading.Thread):
pydevd_tracing.SetTrace(None) # no debugging on this thread
def _warn_pydevd_thread_is_traced(self):
if sys.gettrace():
if self.pydev_do_not_trace and sys.gettrace():
pydevd_log(1, "The debugger thread '%s' is traced which may lead to debugging performance issues." % self.__class__.__name__)
+1 -1
View File
@@ -1810,7 +1810,7 @@ class Dispatcher(object):
self.port = port
self.client = start_client(self.host, self.port)
self.reader = DispatchReader(self)
self.reader.pydev_do_not_trace = False #we run reader in the same thread so we don't want to loose tracing
self.reader.pydev_do_not_trace = False # We run reader in the same thread so we don't want to loose tracing.
self.reader.run()
def close(self):