1
0
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:
Miro Hrončok
2020-02-28 12:48:14 +01:00
committed by Nick Wellnhofer
parent 20c60886e4
commit e4fb368418
2 changed files with 8 additions and 8 deletions

View File

@ -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;