Syntax error "del __py_debug_temp_*" while stopping debugger (PY-25384, EA-103359)

Sometimes debugger changes frame faster than the new command is sent and deleting our util variable produces exception visible for user. We should wrap it with try-except block.
This commit is contained in:
Elizaveta Shashkova
2017-08-07 15:58:07 +03:00
parent b0a0a6b65d
commit d93eb2f606
@@ -262,8 +262,9 @@ public class RemoteDebugger implements ProcessDebugger {
if (frameVars == null || frameVars.size() == 0) continue;
final String expression = "del " + StringUtil.join(frameVars, ",");
final String wrappedExpression = String.format("try:\n %s\nexcept:\n pass", expression);
try {
evaluate(threadId, entry.getKey(), expression, true);
evaluate(threadId, entry.getKey(), wrappedExpression, true);
}
catch (PyDebuggerException e) {
LOG.error(e);