Repository: spark
Updated Branches:
  refs/heads/branch-1.6 3f230f7b3 -> fed453821


[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 <dav...@databricks.com>

Closes #10134 from davies/fix_cltrc.

(cherry picked from commit ef3f047c07ef0ac4a3a97e6bc11e1c28c6c8f9a0)
Signed-off-by: Davies Liu <davies....@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/fed45382
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/fed45382
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/fed45382

Branch: refs/heads/branch-1.6
Commit: fed453821d81470b9035d33e36fa6ef1df99c0de
Parents: 3f230f7
Author: Davies Liu <dav...@databricks.com>
Authored: Mon Dec 7 11:00:25 2015 -0800
Committer: Davies Liu <davies....@gmail.com>
Committed: Mon Dec 7 11:00:34 2015 -0800

----------------------------------------------------------------------
 python/pyspark/context.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/fed45382/python/pyspark/context.py
----------------------------------------------------------------------
diff --git a/python/pyspark/context.py b/python/pyspark/context.py
index 77710a1..529d16b 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):


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to