From: Guido van Rossum Date: Sun, 20 Oct 1991 20:14:56 +0000 (+0000) Subject: Check for EINTR and turn it into KeyboardInterrupt X-Git-Tag: v0.9.8~793 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5063bab9735a7b2d91ad58820c51455f87a9bea1;p=thirdparty%2FPython%2Fcpython.git Check for EINTR and turn it into KeyboardInterrupt in err_errno(). --- diff --git a/Python/errors.c b/Python/errors.c index f1e7151801ee..70a85ba9e78b 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)));