summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-10-20 20:14:56 (GMT)
committerGuido van Rossum <guido@python.org>1991-10-20 20:14:56 (GMT)
commit5063bab9735a7b2d91ad58820c51455f87a9bea1 (patch)
treedf2a920b18d0b2c820b718f8bf7dd3448ac024cb /Python/errors.c
parentd26d9ed2ecea9befa1be5af80fe60b4a4bb4244a (diff)
downloadcpython-5063bab9735a7b2d91ad58820c51455f87a9bea1.zip
cpython-5063bab9735a7b2d91ad58820c51455f87a9bea1.tar.gz
cpython-5063bab9735a7b2d91ad58820c51455f87a9bea1.tar.bz2
Check for EINTR and turn it into KeyboardInterrupt
in err_errno().
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index f1e7151..70a85ba 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -148,7 +148,12 @@ object *
err_errno(exc)
object *exc;
{
- object *v = newtupleobject(2);
+ object *v;
+ if (errno == EINTR && intrcheck()) {
+ err_set(KeyboardInterrupt);
+ return NULL;
+ }
+ v = newtupleobject(2);
if (v != NULL) {
settupleitem(v, 0, newintobject((long)errno));
settupleitem(v, 1, newstringobject(strerror(errno)));