summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml/libxml2/fix-python39.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/libxml/libxml2/fix-python39.patch')
-rw-r--r--meta/recipes-core/libxml/libxml2/fix-python39.patch94
1 files changed, 0 insertions, 94 deletions
diff --git a/meta/recipes-core/libxml/libxml2/fix-python39.patch b/meta/recipes-core/libxml/libxml2/fix-python39.patch
deleted file mode 100644
index 32590f9ddf..0000000000
--- a/meta/recipes-core/libxml/libxml2/fix-python39.patch
+++ /dev/null
@@ -1,94 +0,0 @@
1From e4fb36841800038c289997432ca547c9bfef9db1 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
3Date: Fri, 28 Feb 2020 12:48:14 +0100
4Subject: [PATCH] Parenthesize Py<type>_Check() in ifs
5
6In C, if expressions should be parenthesized.
7PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized
8expression before, but that's not API to rely on.
9
10Since Python 3.9.0a4 it needs to be parenthesized explicitly.
11
12Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
13Upstream-Status: Backport
14Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
15---
16 python/libxml.c | 4 ++--
17 python/types.c | 12 ++++++------
18 2 files changed, 8 insertions(+), 8 deletions(-)
19
20diff --git a/python/libxml.c b/python/libxml.c
21index bc676c4e0..81e709f34 100644
22--- a/python/libxml.c
23+++ b/python/libxml.c
24@@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
25 lenread = PyBytes_Size(ret);
26 data = PyBytes_AsString(ret);
27 #ifdef PyUnicode_Check
28- } else if PyUnicode_Check (ret) {
29+ } else if (PyUnicode_Check (ret)) {
30 #if PY_VERSION_HEX >= 0x03030000
31 Py_ssize_t size;
32 const char *tmp;
33@@ -359,7 +359,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
34 lenread = PyBytes_Size(ret);
35 data = PyBytes_AsString(ret);
36 #ifdef PyUnicode_Check
37- } else if PyUnicode_Check (ret) {
38+ } else if (PyUnicode_Check (ret)) {
39 #if PY_VERSION_HEX >= 0x03030000
40 Py_ssize_t size;
41 const char *tmp;
42diff --git a/python/types.c b/python/types.c
43index c2bafeb19..ed284ec74 100644
44--- a/python/types.c
45+++ b/python/types.c
46@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
47 if (obj == NULL) {
48 return (NULL);
49 }
50- if PyFloat_Check (obj) {
51+ if (PyFloat_Check (obj)) {
52 ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
53- } else if PyLong_Check(obj) {
54+ } else if (PyLong_Check(obj)) {
55 #ifdef PyLong_AS_LONG
56 ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
57 #else
58 ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
59 #endif
60 #ifdef PyBool_Check
61- } else if PyBool_Check (obj) {
62+ } else if (PyBool_Check (obj)) {
63
64 if (obj == Py_True) {
65 ret = xmlXPathNewBoolean(1);
66@@ -620,14 +620,14 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
67 ret = xmlXPathNewBoolean(0);
68 }
69 #endif
70- } else if PyBytes_Check (obj) {
71+ } else if (PyBytes_Check (obj)) {
72 xmlChar *str;
73
74 str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
75 PyBytes_GET_SIZE(obj));
76 ret = xmlXPathWrapString(str);
77 #ifdef PyUnicode_Check
78- } else if PyUnicode_Check (obj) {
79+ } else if (PyUnicode_Check (obj)) {
80 #if PY_VERSION_HEX >= 0x03030000
81 xmlChar *str;
82 const char *tmp;
83@@ -650,7 +650,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
84 ret = xmlXPathWrapString(str);
85 #endif
86 #endif
87- } else if PyList_Check (obj) {
88+ } else if (PyList_Check (obj)) {
89 int i;
90 PyObject *node;
91 xmlNodePtr cur;
92--
93GitLab
94