mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Close issue23467: add %r compatibility to bytes and bytearray
This commit is contained in:
parent
6dd20c2d52
commit
62e977f1b6
3 changed files with 14 additions and 1 deletions
|
|
@ -720,6 +720,8 @@ _PyBytes_Format(PyObject *format, PyObject *args)
|
|||
pbuf = "%";
|
||||
len = 1;
|
||||
break;
|
||||
case 'r':
|
||||
// %r is only for 2/3 code; 3 only code should use %a
|
||||
case 'a':
|
||||
temp = PyObject_ASCII(v);
|
||||
if (temp == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue