Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 17856:2807949e0ba5 legacy-trunk
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 | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Fri, 18 May 2001 20:57:38 +0000 |
| parents | f7c385226f65 |
| children | 79aee498a2be |
line wrap: on
line diff
--- a/Python/getargs.c Fri May 18 20:53:14 2001 +0000 +++ b/Python/getargs.c Fri May 18 20:57:38 2001 +0000 @@ -112,7 +112,7 @@ } else if (level != 0) ; /* Pass */ - else if (c == 'e') + else if (c == 'e') ; /* Pass */ else if (isalpha(c)) max++; @@ -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; @@ -1011,12 +1011,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++; @@ -1035,7 +1033,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 */ @@ -1111,7 +1109,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);
