diff options
author | shadchin <shadchin@yandex-team.com> | 2023-06-18 21:03:32 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2023-06-18 21:03:32 +0300 |
commit | e0ee27b73eae57d28e6c55ec99ab82371c153eaf (patch) | |
tree | 93e413bb7b9206f6165c28d6f9dca8c5b57866a7 /contrib | |
parent | dc0626c403a73e8cea3729070454814636071bfe (diff) | |
download | ydb-e0ee27b73eae57d28e6c55ec99ab82371c153eaf.tar.gz |
Update Cython to 0.29.35
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/tools/cython/.dist-info/METADATA | 2 | ||||
-rw-r--r-- | contrib/tools/cython/CHANGES.rst | 32 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/CodeWriter.py | 5 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/ModuleNode.py | 38 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Naming.py | 2 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Parsing.py | 11 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/TypeSlots.py | 2 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Shadow.py | 2 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Utility/AsyncGen.c | 20 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Utility/Coroutine.c | 22 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Utility/CythonFunction.c | 10 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Utility/ImportExport.c | 51 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Utility/ModuleSetupCode.c | 8 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Utility/TypeConversion.c | 2 | ||||
-rwxr-xr-x | contrib/tools/cython/cython.py | 2 | ||||
-rw-r--r-- | contrib/tools/cython/ya.make | 4 |
16 files changed, 149 insertions, 64 deletions
diff --git a/contrib/tools/cython/.dist-info/METADATA b/contrib/tools/cython/.dist-info/METADATA index 88ca3d9ef5..b09145abae 100644 --- a/contrib/tools/cython/.dist-info/METADATA +++ b/contrib/tools/cython/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Cython -Version: 0.29.34 +Version: 0.29.35 Summary: The Cython compiler for writing C extensions for the Python language. Home-page: http://cython.org/ Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al. diff --git a/contrib/tools/cython/CHANGES.rst b/contrib/tools/cython/CHANGES.rst index 696463f3a1..febc982c4e 100644 --- a/contrib/tools/cython/CHANGES.rst +++ b/contrib/tools/cython/CHANGES.rst @@ -2,6 +2,38 @@ Cython Changelog ================ +0.29.35 (2023-05-24) +==================== + +Bugs fixed +---------- + +* A garbage collection enabled subtype of a non-GC extension type could call into the + deallocation function of the super type with GC tracking enabled. This could lead + to crashes during deallocation if GC was triggered on the type at the same time. + (Github issue :issue:`5432`) + +* Some C compile failures and crashes in CPython 3.12 were resolved. + +* ``except + nogil`` was syntactically not allowed. + ``except +nogil`` (i.e. defining a C++ exception handling function called ``nogil``) + is now disallowed to prevent typos. + (Github issue :issue:`5430`) + +* A C compile failure in PyPy 3.10 was resolved. + Patch by Matti Picus. (Github issue :issue:`5408`) + +* Cython modules now use PEP-489 multi-phase init by default in PyPy 3.9 and later. + Original patch by Matti Picus. (Github issue :issue:`5413`) + +* API header files generated by different Cython versions can now be included in the + same C file. + (Github issue :issue:`5383`) + +* Function signatures containing a type like `tuple[()]` could not be printed. + Patch by Lisandro Dalcin. (Github issue :issue:`5355`) + + 0.29.34 (2023-04-02) ==================== diff --git a/contrib/tools/cython/Cython/CodeWriter.py b/contrib/tools/cython/Cython/CodeWriter.py index 2e4646a654..a5453b90bc 100644 --- a/contrib/tools/cython/Cython/CodeWriter.py +++ b/contrib/tools/cython/Cython/CodeWriter.py @@ -678,7 +678,10 @@ class ExpressionWriter(TreeVisitor): self.visit(node.base) self.put(u"[") if isinstance(node.index, TupleNode): - self.emit_sequence(node.index) + if node.index.subexpr_nodes(): + self.emit_sequence(node.index) + else: + self.put(u"()") else: self.visit(node.index) self.put(u"]") diff --git a/contrib/tools/cython/Cython/Compiler/ModuleNode.py b/contrib/tools/cython/Cython/Compiler/ModuleNode.py index a9b1a492c4..1e392a4e3a 100644 --- a/contrib/tools/cython/Cython/Compiler/ModuleNode.py +++ b/contrib/tools/cython/Cython/Compiler/ModuleNode.py @@ -294,14 +294,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): cname = env.mangle(Naming.func_prefix_api, entry.name) sig = entry.type.signature_string() h_code.putln( - 'if (__Pyx_ImportFunction(module, "%s", (void (**)(void))&%s, "%s") < 0) goto bad;' - % (entry.name, cname, sig)) + 'if (__Pyx_ImportFunction_%s(module, "%s", (void (**)(void))&%s, "%s") < 0) goto bad;' + % (Naming.cyversion, entry.name, cname, sig)) for entry in api_vars: cname = env.mangle(Naming.varptr_prefix_api, entry.name) sig = entry.type.empty_declaration_code() h_code.putln( - 'if (__Pyx_ImportVoidPtr(module, "%s", (void **)&%s, "%s") < 0) goto bad;' - % (entry.name, cname, sig)) + 'if (__Pyx_ImportVoidPtr_%s(module, "%s", (void **)&%s, "%s") < 0) goto bad;' + % (Naming.cyversion, entry.name, cname, sig)) with ModuleImportGenerator(h_code, imported_modules={env.qualified_name: 'module'}) as import_generator: for entry in api_extension_types: self.generate_type_import_call(entry.type, h_code, import_generator, error_code="goto bad;") @@ -1508,28 +1508,25 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): have_gil=True) if base_type: + base_cname = base_type.typeptr_cname if needs_gc: # The base class deallocator probably expects this to be tracked, # so undo the untracking above. if base_type.scope and base_type.scope.needs_gc(): code.putln("PyObject_GC_Track(o);") else: - code.putln("#if CYTHON_USE_TYPE_SLOTS") - code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))") - code.putln("#endif") - code.putln("PyObject_GC_Track(o);") + code.putln("if (PyType_IS_GC(%s)) PyObject_GC_Track(o);" % base_cname) tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot) if tp_dealloc is not None: code.putln("%s(o);" % tp_dealloc) elif base_type.is_builtin_type: - code.putln("%s->tp_dealloc(o);" % base_type.typeptr_cname) + code.putln("%s->tp_dealloc(o);" % base_cname) else: # This is an externally defined type. Calling through the # cimported base type pointer directly interacts badly with # the module cleanup, which may already have cleared it. # In that case, fall back to traversing the type hierarchy. - base_cname = base_type.typeptr_cname code.putln("if (likely(%s)) %s->tp_dealloc(o); " "else __Pyx_call_next_tp_dealloc(o, %s);" % ( base_cname, base_cname, slot_func_cname)) @@ -2964,7 +2961,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): cname = module.mangle(Naming.varptr_prefix, entry.name) signature = entry.type.empty_declaration_code() code.putln( - 'if (__Pyx_ImportVoidPtr(%s, "%s", (void **)&%s, "%s") < 0) %s' % ( + 'if (__Pyx_ImportVoidPtr_%s(%s, "%s", (void **)&%s, "%s") < 0) %s' % ( + Naming.cyversion, temp, entry.name, cname, signature, code.error_goto(self.pos))) code.put_decref_clear(temp, py_object_type) @@ -2989,7 +2987,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.put_gotref(temp) for entry in entries: code.putln( - 'if (__Pyx_ImportFunction(%s, "%s", (void (**)(void))&%s, "%s") < 0) %s' % ( + 'if (__Pyx_ImportFunction_%s(%s, "%s", (void (**)(void))&%s, "%s") < 0) %s' % ( + Naming.cyversion, temp, entry.name, entry.cname, @@ -3066,8 +3065,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): error_code = code.error_goto(error_pos) module = import_generator.imported_module(module_name, error_code) - code.put('%s = __Pyx_ImportType(%s, %s,' % ( + code.put('%s = __Pyx_ImportType_%s(%s, %s,' % ( type.typeptr_cname, + Naming.cyversion, module, module_name)) @@ -3085,12 +3085,15 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): if not condition: code.putln("") # start in new line code.putln("#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000") - code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT(%s),' % (objstruct, objstruct)) + code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT_%s(%s),' % ( + objstruct, Naming.cyversion, objstruct)) code.putln("#else") - code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT(%s),' % (sizeof_objstruct, sizeof_objstruct)) + code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT_%s(%s),' % ( + sizeof_objstruct, Naming.cyversion, sizeof_objstruct)) code.putln("#endif") else: - code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT(%s),' % (objstruct, objstruct)) + code.put('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT_%s(%s),' % ( + objstruct, Naming.cyversion, objstruct)) # check_size if type.check_size and type.check_size in ('error', 'warn', 'ignore'): @@ -3100,7 +3103,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): else: raise RuntimeError("invalid value for check_size '%s' when compiling %s.%s" % ( type.check_size, module_name, type.name)) - code.putln('__Pyx_ImportType_CheckSize_%s);' % check_size.title()) + code.put('__Pyx_ImportType_CheckSize_%s_%s);' % ( + check_size.title(), Naming.cyversion)) code.putln(' if (!%s) %s' % (type.typeptr_cname, error_code)) diff --git a/contrib/tools/cython/Cython/Compiler/Naming.py b/contrib/tools/cython/Cython/Compiler/Naming.py index 2c9b620788..4dd6cbbd5c 100644 --- a/contrib/tools/cython/Cython/Compiler/Naming.py +++ b/contrib/tools/cython/Cython/Compiler/Naming.py @@ -5,8 +5,10 @@ # Prefixes for generating C names. # Collected here to facilitate ensuring uniqueness. # +from .. import __version__ pyrex_prefix = "__pyx_" +cyversion = __version__.replace('.', '_') codewriter_temp_prefix = pyrex_prefix + "t_" diff --git a/contrib/tools/cython/Cython/Compiler/Parsing.py b/contrib/tools/cython/Cython/Compiler/Parsing.py index 20dbc9bbf9..378a41f0e1 100644 --- a/contrib/tools/cython/Cython/Compiler/Parsing.py +++ b/contrib/tools/cython/Cython/Compiler/Parsing.py @@ -2958,11 +2958,18 @@ def p_exception_value_clause(s): s.next() elif s.sy == '+': exc_check = '+' + plus_char_pos = s.position()[2] s.next() if s.sy == 'IDENT': name = s.systring - s.next() - exc_val = p_name(s, name) + if name == 'nogil': + if s.position()[2] == plus_char_pos + 1: + error(s.position(), + "'except +nogil' defines an exception handling function. Use 'except + nogil' for the 'nogil' modifier.") + # 'except + nogil' is parsed outside + else: + exc_val = p_name(s, name) + s.next() elif s.sy == '*': exc_val = ExprNodes.CharNode(s.position(), value=u'*') s.next() diff --git a/contrib/tools/cython/Cython/Compiler/TypeSlots.py b/contrib/tools/cython/Cython/Compiler/TypeSlots.py index c6867447d2..0ef17ede63 100644 --- a/contrib/tools/cython/Cython/Compiler/TypeSlots.py +++ b/contrib/tools/cython/Cython/Compiler/TypeSlots.py @@ -906,7 +906,7 @@ slot_table = ( EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)"), EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"), # PyPy specific extension - only here to avoid C compiler warnings. - EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000"), + EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000"), ) #------------------------------------------------------------------------------------------ diff --git a/contrib/tools/cython/Cython/Shadow.py b/contrib/tools/cython/Cython/Shadow.py index 96296070e5..6c2b44ea37 100644 --- a/contrib/tools/cython/Cython/Shadow.py +++ b/contrib/tools/cython/Cython/Shadow.py @@ -1,7 +1,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.29.34" +__version__ = "0.29.35" try: from __builtin__ import basestring diff --git a/contrib/tools/cython/Cython/Utility/AsyncGen.c b/contrib/tools/cython/Cython/Utility/AsyncGen.c index 9a11d6a129..dd4bf37280 100644 --- a/contrib/tools/cython/Cython/Utility/AsyncGen.c +++ b/contrib/tools/cython/Cython/Utility/AsyncGen.c @@ -430,7 +430,10 @@ static PyTypeObject __pyx_AsyncGenType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -671,7 +674,10 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -789,7 +795,10 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -1080,7 +1089,10 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; diff --git a/contrib/tools/cython/Cython/Utility/Coroutine.c b/contrib/tools/cython/Cython/Utility/Coroutine.c index a02578acd0..aaa8a8e26c 100644 --- a/contrib/tools/cython/Cython/Utility/Coroutine.c +++ b/contrib/tools/cython/Cython/Utility/Coroutine.c @@ -186,7 +186,7 @@ static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) { #endif #if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE) #if PY_VERSION_HEX >= 0x030C00A6 - if (PyGen_CheckExact(obj) && (PyGen_GetCode(obj)->co_flags & CO_ITERABLE_COROUTINE)) { + if (PyGen_CheckExact(obj) && (PyGen_GetCode((PyGenObject*)obj)->co_flags & CO_ITERABLE_COROUTINE)) { #else if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) { #endif @@ -1573,7 +1573,10 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -1736,7 +1739,10 @@ static PyTypeObject __pyx_CoroutineType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -1850,7 +1856,10 @@ static PyTypeObject __pyx_IterableCoroutineType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -1961,7 +1970,10 @@ static PyTypeObject __pyx_GeneratorType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; diff --git a/contrib/tools/cython/Cython/Utility/CythonFunction.c b/contrib/tools/cython/Cython/Utility/CythonFunction.c index dbe9a0a9db..93f577f643 100644 --- a/contrib/tools/cython/Cython/Utility/CythonFunction.c +++ b/contrib/tools/cython/Cython/Utility/CythonFunction.c @@ -747,7 +747,10 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -1279,7 +1282,10 @@ static PyTypeObject __pyx_FusedFunctionType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; diff --git a/contrib/tools/cython/Cython/Utility/ImportExport.c b/contrib/tools/cython/Cython/Utility/ImportExport.c index e1458fc8ff..d6f06ecd7d 100644 --- a/contrib/tools/cython/Cython/Utility/ImportExport.c +++ b/contrib/tools/cython/Cython/Utility/ImportExport.c @@ -8,7 +8,6 @@ #endif #endif - /////////////// Import.proto /////////////// static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ @@ -297,37 +296,39 @@ set_path: /////////////// TypeImport.proto /////////////// +//@substitute: naming -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto +#ifndef __PYX_HAVE_RT_ImportType_proto_$cyversion +#define __PYX_HAVE_RT_ImportType_proto_$cyversion #if __STDC_VERSION__ >= 201112L #include <stdalign.h> #endif #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_$cyversion(s) alignof(s) #else // best guess at what the alignment could be since we can't measure it -#define __PYX_GET_STRUCT_ALIGNMENT(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_$cyversion(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +enum __Pyx_ImportType_CheckSize_$cyversion { + __Pyx_ImportType_CheckSize_Error_$cyversion = 0, + __Pyx_ImportType_CheckSize_Warn_$cyversion = 1, + __Pyx_ImportType_CheckSize_Ignore_$cyversion = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size); /*proto*/ +static PyTypeObject *__Pyx_ImportType_$cyversion(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_$cyversion check_size); /*proto*/ #endif /////////////// TypeImport /////////////// +//@substitute: naming -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_$cyversion +#define __PYX_HAVE_RT_ImportType_$cyversion +static PyTypeObject *__Pyx_ImportType_$cyversion(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_$cyversion check_size) { PyObject *result = 0; char warning[200]; @@ -387,14 +388,14 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_$cyversion && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_$cyversion && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -410,15 +411,16 @@ bad: #endif /////////////// FunctionImport.proto /////////////// +//@substitute: naming -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/ +static int __Pyx_ImportFunction_$cyversion(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/ /////////////// FunctionImport /////////////// //@substitute: naming -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_$cyversion +#define __PYX_HAVE_RT_ImportFunction_$cyversion +static int __Pyx_ImportFunction_$cyversion(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { @@ -515,15 +517,16 @@ bad: } /////////////// VoidPtrImport.proto /////////////// +//@substitute: naming -static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); /*proto*/ +static int __Pyx_ImportVoidPtr_$cyversion(PyObject *module, const char *name, void **p, const char *sig); /*proto*/ /////////////// VoidPtrImport /////////////// //@substitute: naming -#ifndef __PYX_HAVE_RT_ImportVoidPtr -#define __PYX_HAVE_RT_ImportVoidPtr -static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { +#ifndef __PYX_HAVE_RT_ImportVoidPtr_$cyversion +#define __PYX_HAVE_RT_ImportVoidPtr_$cyversion +static int __Pyx_ImportVoidPtr_$cyversion(PyObject *module, const char *name, void **p, const char *sig) { PyObject *d = 0; PyObject *cobj = 0; diff --git a/contrib/tools/cython/Cython/Utility/ModuleSetupCode.c b/contrib/tools/cython/Cython/Utility/ModuleSetupCode.c index ec0a7f9bdc..31a8fec231 100644 --- a/contrib/tools/cython/Cython/Utility/ModuleSetupCode.c +++ b/contrib/tools/cython/Cython/Utility/ModuleSetupCode.c @@ -86,8 +86,12 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS diff --git a/contrib/tools/cython/Cython/Utility/TypeConversion.c b/contrib/tools/cython/Cython/Utility/TypeConversion.c index 7a7bf0f799..404814907e 100644 --- a/contrib/tools/cython/Cython/Utility/TypeConversion.c +++ b/contrib/tools/cython/Cython/Utility/TypeConversion.c @@ -917,7 +917,7 @@ static CYTHON_INLINE {{TYPE}} {{FROM_PY_FUNCTION}}(PyObject *x) { {{endfor}} } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } diff --git a/contrib/tools/cython/cython.py b/contrib/tools/cython/cython.py index 4b91fb9451..19568b3567 100755 --- a/contrib/tools/cython/cython.py +++ b/contrib/tools/cython/cython.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Change content of this file to change uids for cython programs - cython 0.29.34 r0 +# Change content of this file to change uids for cython programs - cython 0.29.35 r0 # # Cython -- Main Program, generic diff --git a/contrib/tools/cython/ya.make b/contrib/tools/cython/ya.make index b035d9104a..50277f428e 100644 --- a/contrib/tools/cython/ya.make +++ b/contrib/tools/cython/ya.make @@ -11,9 +11,9 @@ LICENSE_TEXTS(.yandex_meta/licenses.list.txt) OWNER(g:python-contrib) -VERSION(0.29.34) +VERSION(0.29.35) -ORIGINAL_SOURCE(mirror://pypi/C/Cython/Cython-0.29.34.tar.gz) +ORIGINAL_SOURCE(mirror://pypi/C/Cython/Cython-0.29.35.tar.gz) NO_LINT() |