1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 20:11:17 +00:00

Replace raise with return for Ctrl+C in Windows

- Replace the raise `const.CtrlC` with `return const.CtrlC` the match the
  unix implementation and prevent a stacktrace when cancelling a command
  on Windows
This commit is contained in:
Matt Kotsenas 2016-03-16 16:37:59 -07:00
parent 6daf687237
commit d4bc8cebf1

View File

@ -16,7 +16,7 @@ def get_key():
ch = msvcrt.getch() # second call returns the actual key code
if ch == b'\x03':
raise const.KEY_CTRL_C
return const.KEY_CTRL_C
if ch == b'H':
return const.KEY_UP
if ch == b'P':