mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-45325: Add a new 'p' parameter to Py_BuildValue to convert an integer into a Python bool (#28634)
This commit is contained in:
parent
076300d795
commit
51d4bf1e0e
5 changed files with 42 additions and 0 deletions
|
@ -364,6 +364,11 @@ do_mkvalue(const char **p_format, va_list *p_va)
|
|||
int i = va_arg(*p_va, int);
|
||||
return PyUnicode_FromOrdinal(i);
|
||||
}
|
||||
case 'p':
|
||||
{
|
||||
int i = va_arg(*p_va, int);
|
||||
return PyBool_FromLong(i);
|
||||
}
|
||||
|
||||
case 's':
|
||||
case 'z':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue