FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-146615: Fix format specifiers in Objects/ directory (GH-146620) by miss-islington · Pull Request #146651 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (9) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion Objects/descrobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ property_set_name(PyObject *self, PyObject *args) {
if (PyTuple_GET_SIZE(args) != 2) {
PyErr_Format(
PyExc_TypeError,
"__set_name__() takes 2 positional arguments but %d were given",
"__set_name__() takes 2 positional arguments but %zd were given",
PyTuple_GET_SIZE(args));
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Objects/enumobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ enumerate_vectorcall(PyObject *type, PyObject *const *args,
}

PyErr_Format(PyExc_TypeError,
"enumerate() takes at most 2 arguments (%d given)", nargs + nkwargs);
"enumerate() takes at most 2 arguments (%zd given)", nargs + nkwargs);
return NULL;
}

Expand Down
4 changes: 2 additions & 2 deletions Objects/exceptions.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ BaseExceptionGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!PyExceptionInstance_Check(exc)) {
PyErr_Format(
PyExc_ValueError,
"Item %d of second argument (exceptions) is not an exception",
"Item %zd of second argument (exceptions) is not an exception",
i);
goto error;
}
Expand Down Expand Up @@ -1724,7 +1724,7 @@ PyUnstable_Exc_PrepReraiseStar(PyObject *orig, PyObject *excs)
PyObject *exc = PyList_GET_ITEM(excs, i);
if (exc == NULL || !(PyExceptionInstance_Check(exc) || Py_IsNone(exc))) {
PyErr_Format(PyExc_TypeError,
"item %d of excs is not an exception", i);
"item %zd of excs is not an exception", i);
return NULL;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Objects/funcobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func_set_code(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
if (nclosure != nfree) {
PyErr_Format(PyExc_ValueError,
"%U() requires a code object with %zd free vars,"
" not %zd",
" not %d",
op->func_name,
nclosure, nfree);
return -1;
Expand Down Expand Up @@ -1067,7 +1067,7 @@ func_new_impl(PyTypeObject *type, PyCodeObject *code, PyObject *globals,
nclosure = closure == Py_None ? 0 : PyTuple_GET_SIZE(closure);
if (code->co_nfreevars != nclosure)
return PyErr_Format(PyExc_ValueError,
"%U requires closure of length %zd, not %zd",
"%U requires closure of length %d, not %zd",
code->co_name, code->co_nfreevars, nclosure);
if (nclosure) {
Py_ssize_t i;
Expand Down
2 changes: 1 addition & 1 deletion Objects/memoryobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,7 @@ ptr_from_tuple(const Py_buffer *view, PyObject *tup)

if (nindices > view->ndim) {
PyErr_Format(PyExc_TypeError,
"cannot index %zd-dimension view with %zd-element tuple",
"cannot index %d-dimension view with %zd-element tuple",
view->ndim, nindices);
return NULL;
}
Expand Down
8 changes: 4 additions & 4 deletions Objects/typeobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4894,28 +4894,28 @@ check_basicsize_includes_size_and_offsets(PyTypeObject* type)

if (type->tp_base && type->tp_base->tp_basicsize > type->tp_basicsize) {
PyErr_Format(PyExc_TypeError,
"tp_basicsize for type '%s' (%d) is too small for base '%s' (%d)",
"tp_basicsize for type '%s' (%zd) is too small for base '%s' (%zd)",
type->tp_name, type->tp_basicsize,
type->tp_base->tp_name, type->tp_base->tp_basicsize);
return 0;
}
if (type->tp_weaklistoffset + (Py_ssize_t)sizeof(PyObject*) > max) {
PyErr_Format(PyExc_TypeError,
"weaklist offset %d is out of bounds for type '%s' (tp_basicsize = %d)",
"weaklist offset %zd is out of bounds for type '%s' (tp_basicsize = %zd)",
type->tp_weaklistoffset,
type->tp_name, type->tp_basicsize);
return 0;
}
if (type->tp_dictoffset + (Py_ssize_t)sizeof(PyObject*) > max) {
PyErr_Format(PyExc_TypeError,
"dict offset %d is out of bounds for type '%s' (tp_basicsize = %d)",
"dict offset %zd is out of bounds for type '%s' (tp_basicsize = %zd)",
type->tp_dictoffset,
type->tp_name, type->tp_basicsize);
return 0;
}
if (type->tp_vectorcall_offset + (Py_ssize_t)sizeof(vectorcallfunc*) > max) {
PyErr_Format(PyExc_TypeError,
"vectorcall offset %d is out of bounds for type '%s' (tp_basicsize = %d)",
"vectorcall offset %zd is out of bounds for type '%s' (tp_basicsize = %zd)",
type->tp_vectorcall_offset,
type->tp_name, type->tp_basicsize);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Objects/typevarobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ typevar_typing_prepare_subst_impl(typevarobject *self, PyObject *alias,
}
Py_DECREF(params);
PyErr_Format(PyExc_TypeError,
"Too few arguments for %S; actual %d, expected at least %d",
"Too few arguments for %S; actual %zd, expected at least %zd",
alias, args_len, i + 1);
return NULL;
}
Expand Down
6 changes: 3 additions & 3 deletions Objects/unicodeobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -8550,7 +8550,7 @@ charmap_decode_mapping(const char *s,
goto Undefined;
if (value < 0 || value > MAX_UNICODE) {
PyErr_Format(PyExc_TypeError,
"character mapping must be in range(0x%x)",
"character mapping must be in range(0x%lx)",
(unsigned long)MAX_UNICODE + 1);
goto onError;
}
Expand Down Expand Up @@ -9299,8 +9299,8 @@ charmaptranslate_lookup(Py_UCS4 c, PyObject *mapping, PyObject **result, Py_UCS4
long value = PyLong_AsLong(x);
if (value < 0 || value > MAX_UNICODE) {
PyErr_Format(PyExc_ValueError,
"character mapping must be in range(0x%x)",
MAX_UNICODE+1);
"character mapping must be in range(0x%lx)",
(unsigned long)MAX_UNICODE + 1);
Py_DECREF(x);
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion Objects/unionobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ union_hash(PyObject *self)
}
// The unhashable values somehow became hashable again. Still raise
// an error.
PyErr_Format(PyExc_TypeError, "union contains %d unhashable elements", n);
PyErr_Format(PyExc_TypeError, "union contains %zd unhashable elements", n);
return -1;
}
return PyObject_Hash(alias->hashable_args);
Expand Down
Loading

Back | FazBrowse Home | New Git URL