Imported Upstream version 0.29.10 upstream/0.29.10
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 31 Dec 2020 03:10:18 +0000 (12:10 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 31 Dec 2020 03:10:18 +0000 (12:10 +0900)
CHANGES.rst
Cython/Compiler/Nodes.py
Cython/Compiler/TypeSlots.py
Cython/Shadow.py
Cython/Utility/AsyncGen.c
Cython/Utility/Coroutine.c
Cython/Utility/CythonFunction.c
tests/run/test_unicode.pyx

index f5c74b9..1595106 100644 (file)
@@ -2,6 +2,16 @@
 Cython Changelog
 ================
 
+0.29.10 (2019-06-02)
+====================
+
+Bugs fixed
+----------
+
+* Fix compile errors in CPython 3.8b1 due to the new "tp_vectorcall" slots.
+  (Github issue #2976)
+
+
 0.29.9 (2019-05-29)
 ===================
 
index 07ffd05..4bae6a3 100644 (file)
@@ -4898,7 +4898,10 @@ class CClassDefNode(ClassDefNode):
                     code.error_goto(entry.pos)))
             # Don't inherit tp_print from builtin types, restoring the
             # behavior of using tp_repr or tp_str instead.
+            # ("tp_print" was renamed to "tp_vectorcall_offset" in Py3.8b1)
+            code.putln("#if PY_VERSION_HEX < 0x030800B1")
             code.putln("%s.tp_print = 0;" % typeobj_cname)
+            code.putln("#endif")
 
             # Use specialised attribute lookup for types with generic lookup but no instance dict.
             getattr_slot_func = TypeSlots.get_slot_code_by_name(scope, 'tp_getattro')
index 7cf6cc4..71225a6 100644 (file)
@@ -887,6 +887,7 @@ slot_table = (
     EmptySlot("tp_del"),
     EmptySlot("tp_version_tag"),
     EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"),
+    EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1"),
 )
 
 #------------------------------------------------------------------------------------------
index 2c84503..08ebfb4 100644 (file)
@@ -1,7 +1,7 @@
 # cython.* namespace for pure mode.
 from __future__ import absolute_import
 
-__version__ = "0.29.9"
+__version__ = "0.29.10"
 
 try:
     from __builtin__ import basestring
index e053ecf..d279048 100644 (file)
@@ -421,6 +421,9 @@ static PyTypeObject __pyx_AsyncGenType_type = {
 #elif PY_VERSION_HEX >= 0x030400a1
     0,                                          /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                          /*tp_vectorcall*/
+#endif
 };
 
 
@@ -650,6 +653,9 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     0,                                          /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                          /*tp_vectorcall*/
+#endif
 };
 
 
@@ -759,6 +765,9 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     0,                                          /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                          /*tp_vectorcall*/
+#endif
 };
 
 
@@ -1038,6 +1047,9 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     0,                                          /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                          /*tp_vectorcall*/
+#endif
 };
 
 
index 8cd3138..a221bbc 100644 (file)
@@ -1497,6 +1497,9 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     0,                                  /*tp_finalize*/
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                  /*tp_vectorcall*/
+#endif
 };
 
 #if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
@@ -1655,6 +1658,9 @@ static PyTypeObject __pyx_CoroutineType_type = {
 #elif PY_VERSION_HEX >= 0x030400a1
     0,                                  /*tp_finalize*/
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                  /*tp_vectorcall*/
+#endif
 };
 
 static int __pyx_Coroutine_init(void) {
@@ -1760,6 +1766,9 @@ static PyTypeObject __pyx_IterableCoroutineType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     __Pyx_Coroutine_del,                /*tp_finalize*/
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                  /*tp_vectorcall*/
+#endif
 };
 
 
@@ -1860,6 +1869,9 @@ static PyTypeObject __pyx_GeneratorType_type = {
 #elif PY_VERSION_HEX >= 0x030400a1
     0,                                  /*tp_finalize*/
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                  /*tp_vectorcall*/
+#endif
 };
 
 static int __pyx_Generator_init(void) {
index ed8df54..eef0300 100644 (file)
@@ -730,6 +730,9 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     0,                                  /*tp_finalize*/
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                  /*tp_vectorcall*/
+#endif
 };
 
 
@@ -1203,6 +1206,9 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
 #if PY_VERSION_HEX >= 0x030400a1
     0,                                  /*tp_finalize*/
 #endif
+#if PY_VERSION_HEX >= 0x030800b1
+    0,                                  /*tp_vectorcall*/
+#endif
 };
 
 static int __pyx_FusedFunction_init(void) {
index f69f58c..9d272dd 100644 (file)
@@ -842,8 +842,11 @@ class UnicodeTest(CommonTest,
         self.assertEqual('h\u0130'.capitalize(), 'H\u0069\u0307')
         exp = '\u0399\u0308\u0300\u0069\u0307'
         self.assertEqual('\u1fd2\u0130'.capitalize(), exp)
-        # Note: differs between Py<3.8 and later.
-        #self.assertEqual('finnish'.capitalize(), 'FInnish')
+        if sys.version_info < (3, 8):
+            self.assertEqual('finnish'.capitalize(), 'FInnish')
+        else:
+            self.assertEqual('finnish'.capitalize(), 'Finnish')
+
         self.assertEqual('A\u0345\u03a3'.capitalize(), 'A\u0345\u03c2')
 
     def test_title(self):