diff Python/getargs.c @ 20718:c6384591d846 legacy-trunk

vgetargskeywords: Removed all PyErr_Clear() calls. It's possible that this routine will report an error now when it didn't before, but, if so, it's a legitimate error that should never have been suppressed.
author Tim Peters <tim.peters@gmail.com>
date Sat, 27 Oct 2001 06:14:32 +0000
parents 84715d52d954
children aaefc2f21bae
line wrap: on
line diff
--- a/Python/getargs.c	Sat Oct 27 05:50:39 2001 +0000
+++ b/Python/getargs.c	Sat Oct 27 06:14:32 2001 +0000
@@ -1097,6 +1097,8 @@
 					thiskw);
 				return 0;
 			}
+			else if (PyErr_Occurred())
+				return 0;
 		}
 	}
 
@@ -1107,10 +1109,11 @@
 		for (i = nargs; i < min; i++) {
 			if (PyDict_GetItemString(keywords, kwlist[i]))
 				len++;
+			else if (PyErr_Occurred())
+				return 0;
 		}
 	}
-	PyErr_Clear();	
-	
+
 	/* make sure we got an acceptable number of arguments; the message
 	   is a little confusing with keywords since keyword arguments
 	   which are supplied, but don't match the required arguments
@@ -1159,7 +1162,7 @@
 	  "number of items in format string and keyword list do not match");
 		return 0;
 	}	  	  
-		
+
 	/* convert the keyword arguments; this uses the format 
 	   string where it was left after processing args */
 	converted = 0;
@@ -1178,8 +1181,9 @@
 			}
 			converted++;
 		}
+		else if (PyErr_Occurred())
+			return 0;
 		else {
-			PyErr_Clear();
 			msg = skipitem(&format, p_va);
 			if (msg) {
 				seterror(i+1, msg, levels, fname, message);