* added graalvm (22.0.0.1) - A high-performance JDK distribution
[t2.git] / package / textproc / libxml / python3.9.patch
blob035b5ae0eca05fb5d230ef648e0a148a0ac90f72
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/*/libxml/python3.9.patch
5 # Copyright (C) 2021 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff -ur a/python/libxml.c b/python/libxml.c
18 --- a/python/libxml.c 2019-10-22 20:46:01.000000000 +0200
19 +++ b/python/libxml.c 2021-02-24 13:05:04.578363685 +0100
20 @@ -294,7 +294,7 @@
21 lenread = PyBytes_Size(ret);
22 data = PyBytes_AsString(ret);
23 #ifdef PyUnicode_Check
24 - } else if PyUnicode_Check (ret) {
25 + } else if (PyUnicode_Check (ret)) {
26 #if PY_VERSION_HEX >= 0x03030000
27 Py_ssize_t size;
28 const char *tmp;
29 @@ -359,7 +359,7 @@
30 lenread = PyBytes_Size(ret);
31 data = PyBytes_AsString(ret);
32 #ifdef PyUnicode_Check
33 - } else if PyUnicode_Check (ret) {
34 + } else if (PyUnicode_Check (ret)) {
35 #if PY_VERSION_HEX >= 0x03030000
36 Py_ssize_t size;
37 const char *tmp;
38 diff -ur a/python/types.c b/python/types.c
39 --- a/python/types.c 2019-10-22 20:46:01.000000000 +0200
40 +++ b/python/types.c 2021-02-24 13:05:04.578363685 +0100
41 @@ -602,16 +602,16 @@
42 if (obj == NULL) {
43 return (NULL);
45 - if PyFloat_Check (obj) {
46 + if (PyFloat_Check (obj)) {
47 ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
48 - } else if PyLong_Check(obj) {
49 + } else if (PyLong_Check(obj)) {
50 #ifdef PyLong_AS_LONG
51 ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
52 #else
53 ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
54 #endif
55 #ifdef PyBool_Check
56 - } else if PyBool_Check (obj) {
57 + } else if (PyBool_Check (obj)) {
59 if (obj == Py_True) {
60 ret = xmlXPathNewBoolean(1);
61 @@ -620,14 +620,14 @@
62 ret = xmlXPathNewBoolean(0);
64 #endif
65 - } else if PyBytes_Check (obj) {
66 + } else if (PyBytes_Check (obj)) {
67 xmlChar *str;
69 str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
70 PyBytes_GET_SIZE(obj));
71 ret = xmlXPathWrapString(str);
72 #ifdef PyUnicode_Check
73 - } else if PyUnicode_Check (obj) {
74 + } else if (PyUnicode_Check (obj)) {
75 #if PY_VERSION_HEX >= 0x03030000
76 xmlChar *str;
77 const char *tmp;
78 @@ -650,7 +650,7 @@
79 ret = xmlXPathWrapString(str);
80 #endif
81 #endif
82 - } else if PyList_Check (obj) {
83 + } else if (PyList_Check (obj)) {
84 int i;
85 PyObject *node;
86 xmlNodePtr cur;