diff --git a/python/helpers/pydev/_pydevd_bundle/pydevd_breakpoints.py b/python/helpers/pydev/_pydevd_bundle/pydevd_breakpoints.py index c5842012c1c9..4cbd73f093e9 100644 --- a/python/helpers/pydev/_pydevd_bundle/pydevd_breakpoints.py +++ b/python/helpers/pydev/_pydevd_bundle/pydevd_breakpoints.py @@ -152,6 +152,8 @@ def _excepthook(exctype, value, tb): except: thread.additional_info.pydev_message = exception_breakpoint.qname.encode('utf-8') + thread.additional_info.pydev_message = 'python-%s' % thread.additional_info.pydev_message + pydevd_tracing.SetTrace(None) #no tracing from here pydev_log.debug('Handling post-mortem stop on exception breakpoint %s' % exception_breakpoint.qname) diff --git a/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java b/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java index 918a46940119..fdf6c758557b 100644 --- a/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java +++ b/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java @@ -426,6 +426,7 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Override public void testing() throws Exception { waitForPause(); + waitForOutput("message=\"python-exceptions.ZeroDivisionError\"", "message=\"python-builtins.ZeroDivisionError\""); eval("__exception__[0].__name__").hasValue("'ZeroDivisionError'"); resume(); waitForTerminate(); @@ -469,6 +470,7 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Override public void testing() throws Exception { waitForPause(); + waitForOutput("message=\"python-BaseException\""); eval("__exception__[0].__name__").hasValue("'IndexError'"); resume(); } @@ -522,6 +524,7 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Override public void testing() throws Exception { waitForPause(); + waitForOutput("message=\"python-BaseException\""); eval("stopped_in_user_file").hasValue("True"); resume(); waitForTerminate(); @@ -547,6 +550,7 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Override public void testing() throws Exception { waitForPause(); + waitForOutput("message=\"python-BaseException\""); eval("stopped_in_user_file").hasValue("True"); resume(); waitForTerminate(); @@ -572,6 +576,7 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Override public void testing() throws Exception { waitForPause(); + waitForOutput("message=\"python-BaseException\""); eval("__exception__[0].__name__").hasValue("'ZeroDivisionError'"); resume(); waitForTerminate(); @@ -598,6 +603,7 @@ public class PythonDebuggerTest extends PyEnvTestCase { @Override public void testing() throws Exception { waitForPause(); + waitForOutput("message=\"python-BaseException\""); eval("__exception__[0].__name__").hasValue("'ZeroDivisionError'"); resume(); waitForTerminate(); diff --git a/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java b/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java index 88d4f34783d9..fd7c30d9e3e1 100644 --- a/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java +++ b/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java @@ -40,6 +40,7 @@ import com.jetbrains.env.PyExecutionFixtureTestTask; import com.jetbrains.python.console.PythonDebugLanguageConsoleView; import com.jetbrains.python.debugger.*; import com.jetbrains.python.debugger.pydev.PyDebugCallback; +import org.apache.commons.lang.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; @@ -241,10 +242,14 @@ public abstract class PyBaseDebuggerTask extends PyExecutionFixtureTestTask { pw.flush(); } - private void outputContains(String substring) { + protected void outputContains(String substring) { Assert.assertTrue(output().contains(substring)); } + protected void outputContains(String substring, int times) { + Assert.assertEquals(times, StringUtils.countMatches(output(), substring)); + } + public void setProcessCanTerminate(boolean processCanTerminate) { myProcessCanTerminate = processCanTerminate; }