diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-21 12:26:24 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-21 12:26:24 (GMT) |
commit | 499dfcf29da7b7d1ca11f697cece773936c2ba42 (patch) | |
tree | 5b295eac3254ac6d6f0253d037081d7456ff9d7c /Modules/_testcapimodule.c | |
parent | bfc7bf06a63b5bf4cac0dae7c0d370fbc81563f9 (diff) | |
download | cpython-499dfcf29da7b7d1ca11f697cece773936c2ba42.zip cpython-499dfcf29da7b7d1ca11f697cece773936c2ba42.tar.gz cpython-499dfcf29da7b7d1ca11f697cece773936c2ba42.tar.bz2 |
Issue #10833: Use PyUnicode_FromFormat() and PyErr_Format() instead of
PyOS_snprintf().
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index f19d0df..75dbe57 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -43,11 +43,9 @@ static PyObject* sizeof_error(const char* fatname, const char* typname, int expected, int got) { - char buf[1024]; - PyOS_snprintf(buf, sizeof(buf), - "%.200s #define == %d but sizeof(%.200s) == %d", + PyErr_Format(TestError, + "%s #define == %d but sizeof(%s) == %d", fatname, expected, typname, got); - PyErr_SetString(TestError, buf); return (PyObject*)NULL; } |