Kaydet (Commit) 0f8117f1 authored tarafından Jeremy Hylton's avatar Jeremy Hylton

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().
üst da20fce9
...@@ -166,7 +166,7 @@ vgetargs1(PyObject *args, char *format, va_list *p_va, int compat) ...@@ -166,7 +166,7 @@ vgetargs1(PyObject *args, char *format, va_list *p_va, int compat)
return 0; return 0;
} }
len = PyTuple_Size(args); len = PyTuple_GET_SIZE(args);
if (len < min || max < len) { if (len < min || max < len) {
if (message == NULL) { if (message == NULL) {
...@@ -188,7 +188,7 @@ vgetargs1(PyObject *args, char *format, va_list *p_va, int compat) ...@@ -188,7 +188,7 @@ vgetargs1(PyObject *args, char *format, va_list *p_va, int compat)
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (*format == '|') if (*format == '|')
format++; format++;
msg = convertitem(PyTuple_GetItem(args, i), &format, p_va, msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va,
levels, msgbuf); levels, msgbuf);
if (msg) { if (msg) {
seterror(i+1, msg, levels, fname, message); seterror(i+1, msg, levels, fname, message);
...@@ -1011,12 +1011,10 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format, ...@@ -1011,12 +1011,10 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
else if (c == ':') { else if (c == ':') {
fname = format; fname = format;
break; break;
} } else if (c == ';') {
else if (c == ';') {
message = format; message = format;
break; break;
} } else if (c == 'e')
else if (c == 'e')
; /* Pass */ ; /* Pass */
else if (isalpha(c)) else if (isalpha(c))
max++; max++;
...@@ -1035,7 +1033,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format, ...@@ -1035,7 +1033,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
return 0; 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 */ /* do a cursory check of the keywords just to see how many we got */
...@@ -1111,7 +1109,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format, ...@@ -1111,7 +1109,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
for (i = 0; i < tplen; i++) { for (i = 0; i < tplen; i++) {
if (*format == '|') if (*format == '|')
format++; format++;
msg = convertitem(PyTuple_GetItem(args, i), &format, p_va, msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va,
levels, msgbuf); levels, msgbuf);
if (msg) { if (msg) {
seterror(i+1, msg, levels, fname, message); seterror(i+1, msg, levels, fname, message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment