Skip to content

Commit 43b1eb7

Browse files
committed
Update to lxml 3.6.0
1 parent e717448 commit 43b1eb7

File tree

3 files changed

+26
-90
lines changed

3 files changed

+26
-90
lines changed

test/extra/lxml_patch.patch

Lines changed: 0 additions & 82 deletions
This file was deleted.

test/extra/lxml_test.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ def install_and_test_lxml():
2222
subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR)
2323
subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR)
2424

25-
url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz"
25+
url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.6.0.tar.gz"
2626
subprocess.check_call(["wget", url], cwd=SRC_DIR)
27-
subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR)
28-
LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1"))
29-
30-
PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "lxml_patch.patch"))
31-
subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=LXML_DIR)
32-
print "Applied lxml patch"
27+
subprocess.check_call(["tar", "-zxf", "lxml-3.6.0.tar.gz"], cwd=SRC_DIR)
28+
LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.6.0"))
3329

3430
subprocess.check_call([PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"], cwd=LXML_DIR)
3531

36-
expected = [{'ran': 1381, 'failures': 1}]
32+
expected = [{'ran': 1724, 'failures': 1, 'errors': 1}]
3733
run_test([PYTHON_EXE, "test.py"], cwd=LXML_DIR, expected=expected)
3834

3935
create_virtenv(ENV_NAME, None, force_create = True)

test/integration/Cython-0.22.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,28 @@ index 9cc38f0..ab05ad1 100644
5151
// originally copied from PyCFunction_Call() in CPython's Objects/methodobject.c
5252
// PyPy does not have this function
5353
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
54+
@@ -1143,7 +1145,9 @@
55+
//////////////////// ClassMethod ////////////////////
56+
57+
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
58+
-#if CYTHON_COMPILING_IN_PYPY
59+
+// pyston change:
60+
+// #if CYTHON_COMPILING_IN_PYPY
61+
+#if 0 && CYTHON_COMPILING_IN_PYPY
62+
if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
63+
// cdef classes
64+
return PyClassMethod_New(method);
65+
@@ -1152,7 +1156,9 @@
66+
// It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API
67+
static PyTypeObject *methoddescr_type = NULL;
68+
if (methoddescr_type == NULL) {
69+
- PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
70+
+ // Pyston change:
71+
+ // PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
72+
+ PyObject *meth = PyObject_GetAttrString((PyObject*)&PyUnicode_Type, "split");
73+
if (!meth) return NULL;
74+
methoddescr_type = Py_TYPE(meth);
75+
Py_DECREF(meth);
5476
diff --git a/Cython/Utility/Exceptions.c b/Cython/Utility/Exceptions.c
5577
index 354a776..567970d 100644
5678
--- a/Cython/Utility/Exceptions.c

0 commit comments

Comments
 (0)