mirror of https://github.com/python/cpython
gh-114101: Correct PyErr_Format arguments in _testcapi module (#114102)
- use PyErr_SetString() iso. PyErr_Format() in parse_tuple_and_keywords() - fix misspelled format specifier in CHECK_SIGNNESS() macro
This commit is contained in:
parent
8fd287b18f
commit
6c502ba809
|
@ -56,9 +56,9 @@ parse_tuple_and_keywords(PyObject *self, PyObject *args)
|
|||
keywords[i] = PyBytes_AS_STRING(o);
|
||||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"parse_tuple_and_keywords: "
|
||||
"keywords must be str or bytes", i);
|
||||
"keywords must be str or bytes");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,12 +112,12 @@ test_sizeof_c_types(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
return (PyObject*)NULL; \
|
||||
}
|
||||
#define IS_SIGNED(TYPE) (((TYPE)-1) < (TYPE)0)
|
||||
#define CHECK_SIGNNESS(TYPE, SIGNED) \
|
||||
if (IS_SIGNED(TYPE) != SIGNED) { \
|
||||
PyErr_Format(get_testerror(self), \
|
||||
"%s signness is, instead of %i", \
|
||||
#TYPE, IS_SIGNED(TYPE), SIGNED); \
|
||||
return (PyObject*)NULL; \
|
||||
#define CHECK_SIGNNESS(TYPE, SIGNED) \
|
||||
if (IS_SIGNED(TYPE) != SIGNED) { \
|
||||
PyErr_Format(get_testerror(self), \
|
||||
"%s signness is %i, instead of %i", \
|
||||
#TYPE, IS_SIGNED(TYPE), SIGNED); \
|
||||
return (PyObject*)NULL; \
|
||||
}
|
||||
|
||||
/* integer types */
|
||||
|
|
Loading…
Reference in New Issue