Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1160 from ipython/inputhookqt4

Don't ignore ctrl-C during `%gui qt`

PR #815 ignores ctrl-C during normal code execution, this restores the sigint handler outside the inputhook.

Closes #1157.
  • Loading branch information...
commit 464cb8923a38e1a283b3699aeeabd9cf8d3c4440 2 parents 2c683b7 + a5df66a
@fperez fperez authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 IPython/lib/inputhookqt4.py
View
10 IPython/lib/inputhookqt4.py
@@ -91,21 +91,19 @@ def inputhook_qt4():
timer.start(50)
app.exec_()
timer.stop()
- ignore_CTRL_C()
except KeyboardInterrupt:
ignore_CTRL_C()
got_kbdint[0] = True
- print("\nKeyboardInterrupt - qt4 event loop interrupted!"
- "\n * hit CTRL+C again to clear the prompt"
- "\n * use '%gui none' to disable the event loop"
- " permanently"
- "\n and '%gui qt4' to re-enable it later")
+ print("\nKeyboardInterrupt - Ctrl-C again for new prompt")
mgr.clear_inputhook()
except: # NO exceptions are allowed to escape from a ctypes callback
+ ignore_CTRL_C()
mgr.clear_inputhook()
from traceback import print_exc
print_exc()
print("Got exception from inputhook_qt4, unregistering.")
+ finally:
+ allow_CTRL_C()
return 0
def preprompthook_qt4(ishell):
Please sign in to comment.
Something went wrong with that request. Please try again.