Fix deadlock when creating thread (cannot import modules inside tracing function). Fixes #PyDev-928: Can't debug some software
@@ -14,6 +14,7 @@ from pydevd_tracing import SetTrace
# ELSE
from _pydevd_bundle.pydevd_additional_thread_info import set_additional_thread_info
from _pydevd_bundle.pydevd_frame import PyDBFrame
+from os.path import basename, splitext
# ENDIF
@@ -41,7 +42,7 @@ def trace_dispatch(py_db, frame, event, arg):
thread = None
# Cache the frame which should be traced to deal with unhandled exceptions.
# (i.e.: thread entry-points).
- from os.path import basename, splitext
+
f_unhandled = frame
only_trace_for_unhandled_exceptions = True
# print('called at', f_unhandled.f_code.co_name, f_unhandled.f_code.co_filename, f_unhandled.f_code.co_firstlineno)
