diff Python/getargs.c @ 18307:be9671e61f4a 2.1

Backport Jeremy's checkin 2.57: vgetargs1() and vgetargskeywords(): Replace uses of PyTuple_Size() and PyTuple_GetItem() with PyTuple_GET_SIZE() and PyTuple_GET_ITEM(). The code has already done a PyTuple_Check().
author Thomas Wouters <thomas@python.org>
date Wed, 27 Jun 2001 13:11:09 +0000
parents 9a8e961b505f
children
line wrap: on
line diff
--- a/Python/getargs.c	Wed Jun 27 13:09:44 2001 +0000
+++ b/Python/getargs.c	Wed Jun 27 13:11:09 2001 +0000
@@ -166,7 +166,7 @@
 		return 0;
 	}
 	
-	len = PyTuple_Size(args);
+	len = PyTuple_GET_SIZE(args);
 	
 	if (len < min || max < len) {
 		if (message == NULL) {
@@ -188,8 +188,8 @@
 	for (i = 0; i < len; i++) {
 		if (*format == '|')
 			format++;
-		msg = convertitem(PyTuple_GetItem(args, i), &format, p_va,
-				 levels, msgbuf);
+		msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va,
+				  levels, msgbuf);
 		if (msg) {
 			seterror(i+1, msg, levels, fname, message);
 			return 0;
@@ -995,12 +995,10 @@
 		else if (c == ':') {
 			fname = format;
 			break;
-		}
-		else if (c == ';') {
+		} else if (c == ';') {
 			message = format;
 			break;
-		}
-		else if (c == 'e')
+		} else if (c == 'e')
 			; /* Pass */
 		else if (isalpha(c))
 			max++;
@@ -1019,7 +1017,7 @@
 		return 0;
 	}	
 	
-	tplen = PyTuple_Size(args);
+	tplen = PyTuple_GET_SIZE(args);
 	
 	/* do a cursory check of the keywords just to see how many we got */
 	   
@@ -1095,7 +1093,7 @@
 	for (i = 0; i < tplen; i++) {
 		if (*format == '|')
 			format++;
-		msg = convertitem(PyTuple_GetItem(args, i), &format, p_va,
+		msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va,
 				 levels, msgbuf);
 		if (msg) {
 			seterror(i+1, msg, levels, fname, message);