Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5063bab

Browse files
committed
Check for EINTR and turn it into KeyboardInterrupt
in err_errno().
1 parent d26d9ed commit 5063bab

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Python/errors.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ object *
148148
err_errno(exc)
149149
object *exc;
150150
{
151-
object *v = newtupleobject(2);
151+
object *v;
152+
if (errno == EINTR && intrcheck()) {
153+
err_set(KeyboardInterrupt);
154+
return NULL;
155+
}
156+
v = newtupleobject(2);
152157
if (v != NULL) {
153158
settupleitem(v, 0, newintobject((long)errno));
154159
settupleitem(v, 1, newstringobject(strerror(errno)));

0 commit comments

Comments
 (0)