void () { if (myDebugProcess != null) { ProcessHandler processHandler = myDebugProcess.getProcessHandler(); myDebugProcess.stop(); if (myWaitForTermination) { // for some tests (with infinite loops, for example, it has no sense) waitFor(processHandler); } try { PyDebugValueExecutionService.getInstance(getProject()).shutDownNow(NORMAL_TIMEOUT); } catch (InterruptedException e) { //pass } if (!processHandler.isProcessTerminated()) { killDebugProcess(); if (!waitFor(processHandler)) { new Throwable("Cannot stop debugger process").printStackTrace(); } } } }