void interrupt(Thread pythonThread) {
		final long INTERRUPT_TIMEOUT = 5000;

		if ((pythonThread != null) && pythonThread.isAlive()) {

			// Set trace interrupt flag
			interrupt = Py.KeyboardInterrupt;

			// Wake potentially sleeping python command
			pythonThread.interrupt();

			try {
				pythonThread.join(INTERRUPT_TIMEOUT);
				if (pythonThread.isAlive()) {
					printErr("Cannot interrupt running command");
				}
			}
			catch (InterruptedException e) {
				// Nothing to do
			}
			interrupt = null;
		}
		else {
			printErr("KeyboardInterrupt");
		}
		resetbuffer();
	}
Handle a KeyboardInterrupt.
<p>
This will attempt to interrupt the interpreter if it is running. There are
two types of things this interrupt will work on:
<p>
1: A batched series of python commands (such as a loop).  This works by setting
our interrupt flag that is checked by our {@link InterruptTraceFunction} when
various trace events happen.
<p>
2: A sleeping or otherwise interruptible python command.  Since jython is all
java under the hood, a sleep is really just a {@link Thread#sleep}, which we can
kick with a {@link Thread#interrupt()}.
<p>
If another type of thing is taking a really long time, this interrupt will fail.

@param pythonThread The Python Thread we need to interrupt.
Ghidra/Features/Jython/src/main/java/ghidra/jython/GhidraJythonInterpreter.java