mirror of
https://github.com/python/cpython
synced 2026-09-29 08:20:29 +03:00
When parsing args that return a single character, treat null string the
same as None.
This commit is contained in:
parent
37d2bdfa76
commit
a8292636c6
1 changed files with 1 additions and 1 deletions
|
|
@ -207,7 +207,7 @@ _set_char(const char *name, char *target, PyObject *src, char dflt)
|
|||
if (src == NULL)
|
||||
*target = dflt;
|
||||
else {
|
||||
if (src == Py_None)
|
||||
if (src == Py_None || PyString_Size(src) == 0)
|
||||
*target = '\0';
|
||||
else if (!PyString_Check(src) || PyString_Size(src) != 1) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue