mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-33328 Don't show false settrace warning for Python 2
GitOrigin-RevId: b7ef9da41da2e70e19e2b8ba07d32fd7d7663025
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c0593b39c1
commit
ae87e93cf9
@@ -50,8 +50,8 @@ def _internal_set_trace(tracing_func):
|
||||
if TracingFunctionHolder._warn:
|
||||
frame = get_frame()
|
||||
if frame is not None and frame.f_back is not None:
|
||||
if not frame.f_back.f_code.co_filename.lower().endswith('threading.py'):
|
||||
|
||||
filename = frame.f_back.f_code.co_filename.lower()
|
||||
if not filename.endswith('threading.py') and not filename.endswith('pydevd_tracing.py'):
|
||||
message = \
|
||||
'\nPYDEV DEBUGGER WARNING:' + \
|
||||
'\nsys.settrace() should not be used when the debugger is being used.' + \
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import sys
|
||||
|
||||
sys.settrace(None)
|
||||
@@ -2186,4 +2186,22 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallingSettraceWarning() {
|
||||
runPythonTest(new PyDebuggerTask("/debug", "test_calling_settrace_warning.py") {
|
||||
@Override
|
||||
public void before() {
|
||||
toggleBreakpoint(getFilePath(getScriptName()), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
waitForPause();
|
||||
resume();
|
||||
waitForTerminate();
|
||||
outputContains("PYDEV DEBUGGER WARNING:\nsys.settrace() should not be used when the debugger is being used.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user