diff options
author | shadchin <[email protected]> | 2023-07-22 00:59:02 +0300 |
---|---|---|
committer | shadchin <[email protected]> | 2023-07-22 00:59:02 +0300 |
commit | 7ecf6c16ab762d4ed40a90ea329eebeb1b8cbca0 (patch) | |
tree | 13f625aacca47c9885d8fa31ba97151706ef63bd /contrib/tools/cython/Cython/Compiler | |
parent | 91a8278c558cb2002069ca54215c83568ba6826e (diff) |
Update Cython to 0.29.36
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler')
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Builtin.py | 5 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/ModuleNode.py | 4 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Nodes.py | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/Builtin.py b/contrib/tools/cython/Cython/Compiler/Builtin.py index e0d203ae027..c3e202e0014 100644 --- a/contrib/tools/cython/Cython/Compiler/Builtin.py +++ b/contrib/tools/cython/Cython/Compiler/Builtin.py @@ -417,9 +417,10 @@ def init_builtins(): init_builtin_types() init_builtin_funcs() - builtin_scope.declare_var( + entry = builtin_scope.declare_var( '__debug__', PyrexTypes.c_const_type(PyrexTypes.c_bint_type), - pos=None, cname='(!Py_OptimizeFlag)', is_cdef=True) + pos=None, cname='__pyx_assertions_enabled()', is_cdef=True) + entry.utility_code = UtilityCode.load_cached("AssertionsEnabled", "Exceptions.c") global list_type, tuple_type, dict_type, set_type, frozenset_type global bytes_type, str_type, unicode_type, basestring_type, slice_type diff --git a/contrib/tools/cython/Cython/Compiler/ModuleNode.py b/contrib/tools/cython/Cython/Compiler/ModuleNode.py index 1e392a4e3a5..fd998d419fc 100644 --- a/contrib/tools/cython/Cython/Compiler/ModuleNode.py +++ b/contrib/tools/cython/Cython/Compiler/ModuleNode.py @@ -1469,10 +1469,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): # in Py3.4+, call tp_finalize() as early as possible code.putln("#if CYTHON_USE_TP_FINALIZE") if needs_gc: - finalised_check = '!_PyGC_FINALIZED(o)' + finalised_check = '!__Pyx_PyObject_GC_IsFinalized(o)' else: finalised_check = ( - '(!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))') + '(!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))') code.putln( "if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)" " && Py_TYPE(o)->tp_finalize) && %s) {" % finalised_check) diff --git a/contrib/tools/cython/Cython/Compiler/Nodes.py b/contrib/tools/cython/Cython/Compiler/Nodes.py index f57ddf3dd34..db5d6578297 100644 --- a/contrib/tools/cython/Cython/Compiler/Nodes.py +++ b/contrib/tools/cython/Cython/Compiler/Nodes.py @@ -6215,8 +6215,10 @@ class AssertStatNode(StatNode): gil_message = "Raising exception" def generate_execution_code(self, code): + code.globalstate.use_utility_code( + UtilityCode.load_cached("AssertionsEnabled", "Exceptions.c")) code.putln("#ifndef CYTHON_WITHOUT_ASSERTIONS") - code.putln("if (unlikely(!Py_OptimizeFlag)) {") + code.putln("if (unlikely(__pyx_assertions_enabled())) {") code.mark_pos(self.pos) self.cond.generate_evaluation_code(code) code.putln( |