diff options
author | Guido van Rossum <guido@python.org> | 1991-10-20 20:14:56 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-10-20 20:14:56 +0000 |
commit | 0e4f7c98df7dd811dd94d621f149719d33bc6065 (patch) | |
tree | df2a920b18d0b2c820b718f8bf7dd3448ac024cb /Python/errors.c | |
parent | 69bb77452b1796e9f3b138f285f7dff842444c50 (diff) | |
download | cpython-0e4f7c98df7dd811dd94d621f149719d33bc6065.tar.gz |
Check for EINTR and turn it into KeyboardInterrupt
in err_errno().
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index f1e7151801..70a85ba9e7 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))); |