diff Python/errors.c @ 390:172aa2c3e734 legacy-trunk

Check for EINTR and turn it into KeyboardInterrupt in err_errno().
author Guido van Rossum <guido@python.org>
date Sun, 20 Oct 1991 20:14:56 +0000
parents 853b736a6a9e
children e2c3463c4d91
line wrap: on
line diff
--- a/Python/errors.c	Sun Oct 20 20:13:40 1991 +0000
+++ b/Python/errors.c	Sun Oct 20 20:14:56 1991 +0000
@@ -148,7 +148,12 @@
 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)));