mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)
(cherry picked from commit 8b91edadc0)
Co-authored-by: sth <sth.dev@tejp.de>
This commit is contained in:
committed by
GitHub
parent
e5123d81ff
commit
e4be2057d4
@@ -0,0 +1,2 @@
|
||||
Fix format strings used for stderrprinter and re.Match reprs. Patch by
|
||||
Stephan Hohe.
|
||||
@@ -2319,7 +2319,7 @@ match_repr(MatchObject *self)
|
||||
if (group0 == NULL)
|
||||
return NULL;
|
||||
result = PyUnicode_FromFormat(
|
||||
"<%s object; span=(%d, %d), match=%.50R>",
|
||||
"<%s object; span=(%zd, %zd), match=%.50R>",
|
||||
Py_TYPE(self)->tp_name,
|
||||
self->mark[0], self->mark[1], group0);
|
||||
Py_DECREF(group0);
|
||||
|
||||
@@ -407,7 +407,7 @@ stdprinter_fileno(PyStdPrinter_Object *self)
|
||||
static PyObject *
|
||||
stdprinter_repr(PyStdPrinter_Object *self)
|
||||
{
|
||||
return PyUnicode_FromFormat("<stdprinter(fd=%d) object at 0x%x>",
|
||||
return PyUnicode_FromFormat("<stdprinter(fd=%d) object at %p>",
|
||||
self->fd, self);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user