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
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ enter_task(_PyThreadStateImpl *ts, PyObject *loop, PyObject *task)
PyExc_RuntimeError,
"Cannot enter into task %R while another " \
"task %R is being executed.",
task, ts->asyncio_running_task, NULL);
task, ts->asyncio_running_task);
return -1;
}

Expand All @@ -2265,7 +2265,7 @@ leave_task(_PyThreadStateImpl *ts, PyObject *loop, PyObject *task)
PyExc_RuntimeError,
"Invalid attempt to leave task %R while " \
"task %R is entered.",
task, ts->asyncio_running_task ? ts->asyncio_running_task : Py_None, NULL);
task, ts->asyncio_running_task ? ts->asyncio_running_task : Py_None);
return -1;
}
Py_CLEAR(ts->asyncio_running_task);
Expand Down Expand Up @@ -2328,7 +2328,7 @@ _asyncio_Task___init___impl(TaskObj *self, PyObject *coro, PyObject *loop,
self->task_log_destroy_pending = 0;
PyErr_Format(PyExc_TypeError,
"a coroutine was expected, got %R",
coro, NULL);
coro);
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/_remote_debugging/asyncio.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ parse_task_name(
set_exception_cause(unwinder, PyExc_RuntimeError, "Task name PyLong parsing failed");
return NULL;
}
return PyUnicode_FromFormat("Task-%d", res);
return PyUnicode_FromFormat("Task-%ld", res);
}

if(!(GET_MEMBER(unsigned long, type_obj, unwinder->debug_offsets.type_object.tp_flags) & Py_TPFLAGS_UNICODE_SUBCLASS)) {
Expand Down
14 changes: 5 additions & 9 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,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 @@ -4016,15 +4016,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 @@ -4059,7 +4055,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 @@ -4093,7 +4089,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
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ load_data(zoneinfo_state *state, PyZoneInfo_ZoneInfo *self, PyObject *file_obj)
}

if (!PyTuple_CheckExact(data_tuple)) {
PyErr_Format(PyExc_TypeError, "Invalid data result type: %r",
PyErr_Format(PyExc_TypeError, "Invalid data result type: %R",
data_tuple);
goto error;
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ binascii_a2b_base85_impl(PyObject *module, Py_buffer *data,
state = get_binascii_state(module);
if (state != NULL) {
PyErr_Format(state->Error,
"Base85 overflow in hunk starting at byte %d",
"Base85 overflow in hunk starting at byte %zd",
(data->len - ascii_len) / 5 * 5);
}
goto error;
Expand All @@ -1361,7 +1361,7 @@ binascii_a2b_base85_impl(PyObject *module, Py_buffer *data,
else {
state = get_binascii_state(module);
if (state != NULL) {
PyErr_Format(state->Error, "bad Base85 character at position %d",
PyErr_Format(state->Error, "bad Base85 character at position %zd",
data->len - ascii_len);
}
goto error;
Expand Down
3 changes: 1 addition & 2 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3357,8 +3357,7 @@ sock_setsockopt(PyObject *self, PyObject *args)
arglen = PyTuple_Size(args);
if (arglen == 3 && optval == Py_None) {
PyErr_Format(PyExc_TypeError,
"setsockopt() requires 4 arguments when the third argument is None",
arglen);
"setsockopt() requires 4 arguments when the third argument is None");
return NULL;
}
if (arglen == 4 && optval != Py_None) {
Expand Down
Loading