pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/6c502ba809ff662a5eebf8c6778dec6bd28918fb

55097560d244c08.css" /> gh-114101: Correct PyErr_Format arguments in _testcapi module (#114102) · python/cpython@6c502ba · GitHub
Skip to content

Commit 6c502ba

Browse files
authored
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
1 parent 8fd287b commit 6c502ba

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Modules/_testcapi/getargs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ parse_tuple_and_keywords(PyObject *self, PyObject *args)
5656
keywords[i] = PyBytes_AS_STRING(o);
5757
}
5858
else {
59-
PyErr_Format(PyExc_ValueError,
59+
PyErr_SetString(PyExc_ValueError,
6060
"parse_tuple_and_keywords: "
61-
"keywords must be str or bytes", i);
61+
"keywords must be str or bytes");
6262
goto exit;
6363
}
6464
}

Modules/_testcapimodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ test_sizeof_c_types(PyObject *self, PyObject *Py_UNUSED(ignored))
112112
return (PyObject*)NULL; \
113113
}
114114
#define IS_SIGNED(TYPE) (((TYPE)-1) < (TYPE)0)
115-
#define CHECK_SIGNNESS(TYPE, SIGNED) \
116-
if (IS_SIGNED(TYPE) != SIGNED) { \
117-
PyErr_Format(get_testerror(self), \
118-
"%s signness is, instead of %i", \
119-
#TYPE, IS_SIGNED(TYPE), SIGNED); \
120-
return (PyObject*)NULL; \
115+
#define CHECK_SIGNNESS(TYPE, SIGNED) \
116+
if (IS_SIGNED(TYPE) != SIGNED) { \
117+
PyErr_Format(get_testerror(self), \
118+
"%s signness is %i, instead of %i", \
119+
#TYPE, IS_SIGNED(TYPE), SIGNED); \
120+
return (PyObject*)NULL; \
121121
}
122122

123123
/* integer types */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy