diff options
author | Davies Liu <davies@databricks.com> | 2015-12-07 11:00:25 -0800 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2015-12-07 11:00:25 -0800 |
commit | ef3f047c07ef0ac4a3a97e6bc11e1c28c6c8f9a0 (patch) | |
tree | 0172f35b2e335b8aa0b813285c06334494f2c74f | |
parent | 39d677c8f1ee7ebd7e142bec0415cf8f90ac84b6 (diff) | |
download | spark-ef3f047c07ef0ac4a3a97e6bc11e1c28c6c8f9a0.tar.gz spark-ef3f047c07ef0ac4a3a97e6bc11e1c28c6c8f9a0.tar.bz2 spark-ef3f047c07ef0ac4a3a97e6bc11e1c28c6c8f9a0.zip |
[SPARK-12132] [PYSPARK] raise KeyboardInterrupt inside SIGINT handler
Currently, the current line is not cleared by Cltr-C
After this patch
```
>>> asdfasdf^C
Traceback (most recent call last):
File "~/spark/python/pyspark/context.py", line 225, in signal_handler
raise KeyboardInterrupt()
KeyboardInterrupt
```
It's still worse than 1.5 (and before).
Author: Davies Liu <davies@databricks.com>
Closes #10134 from davies/fix_cltrc.
-rw-r--r-- | python/pyspark/context.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/python/pyspark/context.py b/python/pyspark/context.py index 77710a1339..529d16b480 100644 --- a/python/pyspark/context.py +++ b/python/pyspark/context.py @@ -222,6 +222,7 @@ class SparkContext(object): # create a signal handler which would be invoked on receiving SIGINT def signal_handler(signal, frame): self.cancelAllJobs() + raise KeyboardInterrupt() # see http://stackoverflow.com/questions/23206787/ if isinstance(threading.current_thread(), threading._MainThread): |