]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Check for EINTR and turn it into KeyboardInterrupt
authorGuido van Rossum <guido@python.org>
Sun, 20 Oct 1991 20:14:56 +0000 (20:14 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 20 Oct 1991 20:14:56 +0000 (20:14 +0000)
in err_errno().

Python/errors.c

index f1e7151801ee8c6f2f47d9ceb9f718cb0f5aa9a3..70a85ba9e78b944a0222e97d80ffa8fec1eb5cb0 100644 (file)
@@ -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)));