[3.14] gh-146615: Fix format specifiers in extension modules (GH-146617) by serhiy-storchaka · Pull Request #146652 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Modules/_asynciomodule.c
14 changes: 5 additions & 9 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ fill_and_set_sslerror(_sslmodulestate *state,
}
else {
if (PyUnicodeWriter_Format(
writer, "unknown error (0x%x)", errcode) < 0) {
writer, "unknown error (0x%lx)", errcode) < 0) {
goto fail;
}
}
Expand Down Expand Up @@ -3597,15 +3597,11 @@ _ssl__SSLContext_verify_flags_set_impl(PySSLContext *self, PyObject *value)
static int
set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what)
{
long v;
int v;
int result;

if (!PyArg_Parse(arg, "l", &v))
if (!PyArg_Parse(arg, "i", &v))
return -1;
if (v > INT_MAX) {
PyErr_SetString(PyExc_OverflowError, "Option is too long");
return -1;
}

switch(self->protocol) {
case PY_SSL_VERSION_TLS_CLIENT: _Py_FALLTHROUGH;
Expand Down Expand Up @@ -3640,7 +3636,7 @@ set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what)
break;
default:
PyErr_Format(PyExc_ValueError,
"Unsupported TLS/SSL version 0x%x", v);
"Unsupported TLS/SSL version 0x%x", (unsigned)v);
return -1;
}

Expand Down Expand Up @@ -3674,7 +3670,7 @@ set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what)
}
if (result == 0) {
PyErr_Format(PyExc_ValueError,
"Unsupported protocol version 0x%x", v);
"Unsupported protocol version 0x%x", (unsigned)v);
return -1;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_zoneinfo.c
Loading