Commit 8b91edad authored by sth's avatar sth Committed by Serhiy Storchaka

bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)

parent ca7fe506
Fix format strings used for stderrprinter and re.Match reprs. Patch by
Stephan Hohe.
......@@ -2306,7 +2306,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);
......
......@@ -411,7 +411,7 @@ stdprinter_fileno(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored))
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment