mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-05 19:01:18 +03:00
Parenthesize Py<type>_Check() in ifs
In C, if expressions should be parenthesized. PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized expression before, but that's not API to rely on. Since Python 3.9.0a4 it needs to be parenthesized explicitly. Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
This commit is contained in:
committed by
Nick Wellnhofer
parent
20c60886e4
commit
e4fb368418
@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
|
||||
lenread = PyBytes_Size(ret);
|
||||
data = PyBytes_AsString(ret);
|
||||
#ifdef PyUnicode_Check
|
||||
} else if PyUnicode_Check (ret) {
|
||||
} else if (PyUnicode_Check (ret)) {
|
||||
#if PY_VERSION_HEX >= 0x03030000
|
||||
Py_ssize_t size;
|
||||
const char *tmp;
|
||||
@ -359,7 +359,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
|
||||
lenread = PyBytes_Size(ret);
|
||||
data = PyBytes_AsString(ret);
|
||||
#ifdef PyUnicode_Check
|
||||
} else if PyUnicode_Check (ret) {
|
||||
} else if (PyUnicode_Check (ret)) {
|
||||
#if PY_VERSION_HEX >= 0x03030000
|
||||
Py_ssize_t size;
|
||||
const char *tmp;
|
||||
|
Reference in New Issue
Block a user