Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Cython for openSUSE:Factory checked in at 2023-04-06 15:55:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Cython (Old) and /work/SRC/openSUSE:Factory/.python-Cython.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Cython" Thu Apr 6 15:55:33 2023 rev:69 rq:1077062 version:0.29.34 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Cython/python-Cython.changes 2023-01-14 20:31:42.233207951 +0100 +++ /work/SRC/openSUSE:Factory/.python-Cython.new.19717/python-Cython.changes 2023-04-06 15:55:33.620166557 +0200 @@ -1,0 +2,15 @@ +Mon Apr 3 19:58:40 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 0.29.34: + * A refence leak of the for-loop list/tuple iterable was + resolved if the for-loop's ``else:`` branch executes + a ``break`` for an outer loop. + * Some C compile failures in CPython 3.12 were resolved. + * Some old usages of the deprecated Python ``imp`` module were + replaced with ``importlib``. + * Patch by Matúš Valo. (Github issue :issue:`5300`) + * Some issues with ``depfile`` generation were resolved. + * Patches by Eli Schwartz. (Github issues :issue:`5279`, + :issue:`5291`) + +------------------------------------------------------------------- Old: ---- Cython-0.29.33.tar.gz New: ---- Cython-0.29.34.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Cython.spec ++++++ --- /var/tmp/diff_new_pack.8qBhqu/_old 2023-04-06 15:55:34.096169246 +0200 +++ /var/tmp/diff_new_pack.8qBhqu/_new 2023-04-06 15:55:34.100169268 +0200 @@ -18,7 +18,7 @@ %bcond_with test Name: python-Cython -Version: 0.29.33 +Version: 0.29.34 Release: 0 Summary: The Cython compiler for writing C extensions for the Python language License: Apache-2.0 ++++++ Cython-0.29.33.tar.gz -> Cython-0.29.34.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/.gitrev new/Cython-0.29.34/.gitrev --- old/Cython-0.29.33/.gitrev 2023-01-05 23:13:09.741008500 +0100 +++ new/Cython-0.29.34/.gitrev 2023-04-02 15:27:09.005781200 +0200 @@ -1 +1 @@ -d675bf287ba2b60c362a1fac80f8338565756675 +81cc29aedc0d0df69e81812cb8321cc0bcf41065 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/CHANGES.rst new/Cython-0.29.34/CHANGES.rst --- old/Cython-0.29.33/CHANGES.rst 2023-01-05 23:13:06.705019000 +0100 +++ new/Cython-0.29.34/CHANGES.rst 2023-04-02 15:27:02.281669100 +0200 @@ -2,6 +2,25 @@ Cython Changelog ================ +0.29.34 (2023-04-02) +==================== + +Bugs fixed +---------- + +* A refence leak of the for-loop list/tuple iterable was resolved if the for-loop's + ``else:`` branch executes a ``break`` for an outer loop. + (Github issue :issue:`5347`) + +* Some C compile failures in CPython 3.12 were resolved. + +* Some old usages of the deprecated Python ``imp`` module were replaced with ``importlib``. + Patch by Matúš Valo. (Github issue :issue:`5300`) + +* Some issues with ``depfile`` generation were resolved. + Patches by Eli Schwartz. (Github issues :issue:`5279`, :issue:`5291`) + + 0.29.33 (2023-01-06) ==================== @@ -83,6 +102,9 @@ * A new argument ``--module-name`` was added to the ``cython`` command to provide the (one) exact target module name from the command line. Patch by Matthew Brett and h-vetinari. (Github issue #4906) + +* A new keyword ``noexcept`` was added for forward compatibility with Cython 3. + Patch by David Woods. (Github issue #4903) Bugs fixed ---------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Build/Dependencies.py new/Cython-0.29.34/Cython/Build/Dependencies.py --- old/Cython-0.29.33/Cython/Build/Dependencies.py 2023-01-05 23:13:06.705019000 +0100 +++ new/Cython-0.29.34/Cython/Build/Dependencies.py 2023-04-02 15:27:02.281669100 +0200 @@ -963,6 +963,9 @@ pythran_options.cplus = True pythran_options.np_pythran = True + if force is None: + force = os.environ.get("CYTHON_FORCE_REGEN") == "1" # allow global overrides for build systems + c_options = CompilationOptions(**options) cpp_options = CompilationOptions(**options); cpp_options.cplus = True ctx = c_options.create_context() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Build/Inline.py new/Cython-0.29.34/Cython/Build/Inline.py --- old/Cython-0.29.33/Cython/Build/Inline.py 2023-01-05 23:13:06.705019000 +0100 +++ new/Cython-0.29.34/Cython/Build/Inline.py 2023-04-02 15:27:02.281669100 +0200 @@ -39,11 +39,12 @@ def load_dynamic(name, module_path): return imp.load_dynamic(name, module_path) else: - import importlib.util as _importlib_util - def load_dynamic(name, module_path): - spec = _importlib_util.spec_from_file_location(name, module_path) - module = _importlib_util.module_from_spec(spec) - # sys.modules[name] = module + import importlib.util + from importlib.machinery import ExtensionFileLoader + + def load_dynamic(name, path): + spec = importlib.util.spec_from_file_location(name, loader=ExtensionFileLoader(name, path)) + module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Build/IpythonMagic.py new/Cython-0.29.34/Cython/Build/IpythonMagic.py --- old/Cython-0.29.33/Cython/Build/IpythonMagic.py 2023-01-05 23:13:06.705019000 +0100 +++ new/Cython-0.29.34/Cython/Build/IpythonMagic.py 2023-04-02 15:27:02.281669100 +0200 @@ -46,7 +46,6 @@ from __future__ import absolute_import, print_function -import imp import io import os import re @@ -84,7 +83,7 @@ from ..Shadow import __version__ as cython_version from ..Compiler.Errors import CompileError -from .Inline import cython_inline +from .Inline import cython_inline, load_dynamic from .Dependencies import cythonize @@ -348,7 +347,7 @@ # Build failed and printed error message return None - module = imp.load_dynamic(module_name, module_path) + module = load_dynamic(module_name, module_path) self._import_all(module) if args.annotate: @@ -411,7 +410,7 @@ # import and execute module code to generate profile so_module_path = os.path.join(lib_dir, pgo_module_name + self.so_ext) - imp.load_dynamic(pgo_module_name, so_module_path) + load_dynamic(pgo_module_name, so_module_path) def _cythonize(self, module_name, code, lib_dir, args, quiet=True): pyx_file = os.path.join(lib_dir, module_name + '.pyx') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Compiler/Main.py new/Cython-0.29.34/Cython/Compiler/Main.py --- old/Cython-0.29.33/Cython/Compiler/Main.py 2023-01-05 23:13:06.713019000 +0100 +++ new/Cython-0.29.34/Cython/Compiler/Main.py 2023-04-02 15:27:02.289669300 +0200 @@ -514,7 +514,7 @@ context.setup_errors(options, result) err, enddata = Pipeline.run_pipeline(pipeline, source) context.teardown_errors(err, options, result) - if options.depfile: + if err is None and options.depfile: from ..Build.Dependencies import create_dependency_tree dependencies = create_dependency_tree(context).all_dependencies(result.main_source_file) Utils.write_depfile(result.c_file, result.main_source_file, dependencies) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Compiler/ModuleNode.py new/Cython-0.29.34/Cython/Compiler/ModuleNode.py --- old/Cython-0.29.33/Cython/Compiler/ModuleNode.py 2023-01-05 23:13:06.713019000 +0100 +++ new/Cython-0.29.34/Cython/Compiler/ModuleNode.py 2023-04-02 15:27:02.289669300 +0200 @@ -3078,12 +3078,12 @@ if not condition: code.putln("") # start in new line code.putln("#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000") - code.putln('sizeof(%s),' % objstruct) + code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT(%s),' % (objstruct, objstruct)) code.putln("#else") - code.putln('sizeof(%s),' % sizeof_objstruct) + code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT(%s),' % (sizeof_objstruct, sizeof_objstruct)) code.putln("#endif") else: - code.put('sizeof(%s), ' % objstruct) + code.putln('sizeof(%s), __PYX_GET_STRUCT_ALIGNMENT(%s),' % (objstruct, objstruct)) # check_size if type.check_size and type.check_size in ('error', 'warn', 'ignore'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Compiler/Nodes.py new/Cython-0.29.34/Cython/Compiler/Nodes.py --- old/Cython-0.29.33/Cython/Compiler/Nodes.py 2023-01-05 23:13:06.713019000 +0100 +++ new/Cython-0.29.34/Cython/Compiler/Nodes.py 2023-04-02 15:27:02.293669500 +0200 @@ -6723,23 +6723,28 @@ code.set_loop_labels(old_loop_labels) if self.else_clause: - # in nested loops, the 'else' block can contain a - # 'continue' statement for the outer loop, but we may need - # to generate cleanup code before taking that path, so we - # intercept it here - orig_continue_label = code.continue_label + # In nested loops, the 'else' block can contain 'continue' or 'break' + # statements for the outer loop, but we may need to generate cleanup code + # before taking those paths, so we intercept them here. + orig_exit_labels = (code.continue_label, code.break_label) code.continue_label = code.new_label('outer_continue') + code.break_label = code.new_label('outer_break') code.putln("/*else*/ {") self.else_clause.generate_execution_code(code) code.putln("}") - if code.label_used(code.continue_label): - code.put_goto(break_label) + needs_goto_end = not self.else_clause.is_terminator + for exit_label, orig_exit_label in zip([code.continue_label, code.break_label], orig_exit_labels): + if not code.label_used(exit_label): + continue + if needs_goto_end: + code.put_goto(break_label) + needs_goto_end = False code.mark_pos(self.pos) - code.put_label(code.continue_label) + code.put_label(exit_label) self.iterator.generate_disposal_code(code) - code.put_goto(orig_continue_label) + code.put_goto(orig_exit_label) code.set_loop_labels(old_loop_labels) code.mark_pos(self.pos) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Includes/cpython/pycapsule.pxd new/Cython-0.29.34/Cython/Includes/cpython/pycapsule.pxd --- old/Cython-0.29.33/Cython/Includes/cpython/pycapsule.pxd 2023-01-05 23:13:06.725019000 +0100 +++ new/Cython-0.29.34/Cython/Includes/cpython/pycapsule.pxd 2023-04-02 15:27:02.305669500 +0200 @@ -13,7 +13,7 @@ # access C APIs defined in dynamically loaded modules. - ctypedef void (*PyCapsule_Destructor)(object o) + ctypedef void (*PyCapsule_Destructor)(object o) noexcept # The type of a destructor callback for a capsule. # # See PyCapsule_New() for the semantics of PyCapsule_Destructor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Shadow.py new/Cython-0.29.34/Cython/Shadow.py --- old/Cython-0.29.33/Cython/Shadow.py 2023-01-05 23:13:06.725019000 +0100 +++ new/Cython-0.29.34/Cython/Shadow.py 2023-04-02 15:27:02.309669700 +0200 @@ -1,7 +1,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.29.33" +__version__ = "0.29.34" try: from __builtin__ import basestring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Utility/Coroutine.c new/Cython-0.29.34/Cython/Utility/Coroutine.c --- old/Cython-0.29.33/Cython/Utility/Coroutine.c 2023-01-05 23:13:06.729019000 +0100 +++ new/Cython-0.29.34/Cython/Utility/Coroutine.c 2023-04-02 15:27:02.309669700 +0200 @@ -185,7 +185,11 @@ } else #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)) { +#else if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) { +#endif // Python generator marked with "@types.coroutine" decorator return __Pyx_NewRef(obj); } else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Utility/Exceptions.c new/Cython-0.29.34/Cython/Utility/Exceptions.c --- old/Cython-0.29.33/Cython/Utility/Exceptions.c 2023-01-05 23:13:06.729019000 +0100 +++ new/Cython-0.29.34/Cython/Utility/Exceptions.c 2023-04-02 15:27:02.309669700 +0200 @@ -284,13 +284,7 @@ PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -298,6 +292,12 @@ tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Utility/ImportExport.c new/Cython-0.29.34/Cython/Utility/ImportExport.c --- old/Cython-0.29.33/Cython/Utility/ImportExport.c 2023-01-05 23:13:06.729019000 +0100 +++ new/Cython-0.29.34/Cython/Utility/ImportExport.c 2023-04-02 15:27:02.313669700 +0200 @@ -301,13 +301,24 @@ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto +#if __STDC_VERSION__ >= 201112L +#include <stdalign.h> +#endif + +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT(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*) +#endif + enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); /*proto*/ +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*/ #endif @@ -316,13 +327,15 @@ #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, enum __Pyx_ImportType_CheckSize check_size) + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); @@ -336,6 +349,7 @@ } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -345,8 +359,28 @@ py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + // If itemsize is smaller than the alignment the struct can end up with some extra + // padding at the end. In this case we need to work out the maximum size that + // the padding could be when calculating the range of valid struct sizes. + if (size % alignment) { + // if this is true we've probably calculated the alignment wrongly + // (most likely because alignof isn't available) + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Utility/ModuleSetupCode.c new/Cython-0.29.34/Cython/Utility/ModuleSetupCode.c --- old/Cython-0.29.33/Cython/Utility/ModuleSetupCode.c 2023-01-05 23:13:06.729019000 +0100 +++ new/Cython-0.29.34/Cython/Utility/ModuleSetupCode.c 2023-04-02 15:27:02.313669700 +0200 @@ -208,7 +208,8 @@ #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) - #define CYTHON_USE_PYLONG_INTERNALS 1 + // PyLong internals changed in Py3.12. + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -252,7 +253,8 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + // The dict version field is now deprecated in Py3.12. + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/Cython/Utils.py new/Cython-0.29.34/Cython/Utils.py --- old/Cython-0.29.33/Cython/Utils.py 2023-01-05 23:13:06.733018900 +0100 +++ new/Cython-0.29.34/Cython/Utils.py 2023-04-02 15:27:02.313669700 +0200 @@ -459,9 +459,14 @@ for fname in dependencies: fname = os.path.abspath(fname) if fname.startswith(src_base_dir): - paths.append(os.path.relpath(fname, cwd)) + try: + newpath = os.path.relpath(fname, cwd) + except ValueError: + # if they are on different Windows drives, absolute is fine + newpath = fname else: - paths.append(fname) + newpath = fname + paths.append(newpath) depline = os.path.relpath(target, cwd) + ": \\\n " depline += " \\\n ".join(paths) + "\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/PKG-INFO new/Cython-0.29.34/PKG-INFO --- old/Cython-0.29.33/PKG-INFO 2023-01-05 23:13:15.065041300 +0100 +++ new/Cython-0.29.34/PKG-INFO 2023-04-02 15:27:16.221897600 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Cython -Version: 0.29.33 +Version: 0.29.34 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. @@ -27,6 +27,7 @@ Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Programming Language :: C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/runtests.py new/Cython-0.29.34/runtests.py --- old/Cython-0.29.33/runtests.py 2023-01-05 23:13:06.749019000 +0100 +++ new/Cython-0.29.34/runtests.py 2023-04-02 15:27:02.341670300 +0200 @@ -429,6 +429,12 @@ 'run.pep526_variable_annotations', # typing module 'run.test_exceptions', # copied from Py3.7+ ]), + (3,11,999): (operator.gt, lambda x: x in [ + 'run.py_unicode_strings', # Py_UNICODE was removed + 'compile.pylong', # PyLongObject changed its structure + 'run.longintrepr', # PyLongObject changed its structure + ]), + } INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/setup.py new/Cython-0.29.34/setup.py --- old/Cython-0.29.33/setup.py 2023-01-05 23:13:06.749019000 +0100 +++ new/Cython-0.29.34/setup.py 2023-04-02 15:27:02.341670300 +0200 @@ -274,6 +274,7 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: C", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/tests/run/for_in_break_continue_T533.pyx new/Cython-0.29.34/tests/run/for_in_break_continue_T533.pyx --- old/Cython-0.29.33/tests/run/for_in_break_continue_T533.pyx 2023-01-05 23:13:06.777018800 +0100 +++ new/Cython-0.29.34/tests/run/for_in_break_continue_T533.pyx 2023-04-02 15:27:02.385671000 +0200 @@ -1,4 +1,6 @@ -# ticket: 533 +# mode: run +# ticket: t533 +# ticket: gh1093 def for_in(): """ @@ -20,6 +22,7 @@ break return i + def for_from(): """ >>> for_from() @@ -39,3 +42,27 @@ print "BREAK", i break return i + + +def for_in_break2(data, avoid): + """ + >>> for_in_break2([1,2,3,None], avoid=[1,2,3]) + 3 + >>> for_in_break2([1,2,3,None], avoid=[1]) + 1 + >>> for_in_break2([1,2,3,None], avoid=[1]) + 1 + """ + data_iter = iter(data) + value = None + while 1: + match = next(data_iter) + if match is None: + break + for value in avoid: + if match == value: + break + else: + break + + return value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/tests/run/pycapsule.pyx new/Cython-0.29.34/tests/run/pycapsule.pyx --- old/Cython-0.29.33/tests/run/pycapsule.pyx 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.29.34/tests/run/pycapsule.pyx 2023-04-02 15:27:02.397671200 +0200 @@ -0,0 +1,33 @@ +# mode: run + +import gc +from cpython cimport pycapsule + +cdef int value = 5 +cdef bint destructed = False + +cdef void destructor(object obj) noexcept: + # PyPy's GC does not guarantee immediate execution. + global destructed + destructed = True + + +def was_destructed(): + return destructed + + +def test_capsule(): + """ + >>> test_capsule() + True + >>> _ = gc.collect() + >>> was_destructed() # let's assume that gc.collect() is enough to assert this + True + """ + capsule = pycapsule.PyCapsule_New(&value, b"simple value", &destructor) + + assert pycapsule.PyCapsule_GetName(capsule) == b"simple value" + assert pycapsule.PyCapsule_GetPointer(capsule, b"simple value") is &value + assert pycapsule.PyCapsule_GetDestructor(capsule) is &destructor + + return pycapsule.PyCapsule_IsValid(capsule, b"simple value") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/tests/run/special_methods_T561.pyx new/Cython-0.29.34/tests/run/special_methods_T561.pyx --- old/Cython-0.29.33/tests/run/special_methods_T561.pyx 2023-01-05 23:13:06.785018700 +0100 +++ new/Cython-0.29.34/tests/run/special_methods_T561.pyx 2023-04-02 15:27:02.401671200 +0200 @@ -49,10 +49,10 @@ >>> g01 = object.__getattribute__(GetAttr(), '__getattribute__') >>> g01('attr') GetAttr getattr 'attr' - >>> g10 = object.__getattribute__(GetAttribute(), '__getattr__') + >>> g10 = object.__getattribute__(GetAttribute(), '__getattr__') # doctest: +ELLIPSIS Traceback (most recent call last): ... - AttributeError: 'special_methods_T561.GetAttribute' object has no attribute '__getattr__' + AttributeError: 'special_methods_T561.GetAttribute' object has no attribute '__getattr__'... >>> g11 = object.__getattribute__(GetAttribute(), '__getattribute__') >>> g11('attr') GetAttribute getattribute 'attr' @@ -62,15 +62,15 @@ >>> sa_setattr('foo', 'bar') SetAttr setattr 'foo' 'bar' >>> sa_delattr = SetAttr().__delattr__ - >>> sa_delattr('foo') + >>> sa_delattr('foo') # doctest: +ELLIPSIS Traceback (most recent call last): ... - AttributeError: 'special_methods_T561.SetAttr' object has no attribute 'foo' + AttributeError: 'special_methods_T561.SetAttr' object has no attribute 'foo'... >>> da_setattr = DelAttr().__setattr__ - >>> da_setattr('foo', 'bar') + >>> da_setattr('foo', 'bar') # doctest: +ELLIPSIS Traceback (most recent call last): ... - AttributeError: 'special_methods_T561.DelAttr' object has no attribute 'foo' + AttributeError: 'special_methods_T561.DelAttr' object has no attribute 'foo'... >>> da_delattr = DelAttr().__delattr__ >>> da_delattr('foo') DelAttr delattr 'foo' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.33/tests/run/special_methods_T561_py3.pyx new/Cython-0.29.34/tests/run/special_methods_T561_py3.pyx --- old/Cython-0.29.33/tests/run/special_methods_T561_py3.pyx 2023-01-05 23:13:06.785018700 +0100 +++ new/Cython-0.29.34/tests/run/special_methods_T561_py3.pyx 2023-04-02 15:27:02.401671200 +0200 @@ -7,47 +7,44 @@ __doc__ = u""" >>> vs0 = VerySpecial(0) VS __init__ 0 + >>> # Python 3 does not use __cmp__, so any provided __cmp__ method is >>> # discarded under Python 3. - >>> vs0_cmp = vs0.__cmp__ + >>> vs0_cmp = vs0.__cmp__ # doctest: +ELLIPSIS Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__cmp__' + AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__cmp__'... + >>> # Python 3 does not use __div__ or __idiv__, so these methods are >>> # discarded under Python 3. - >>> vs0_div = vs0.__div__ + >>> vs0_div = vs0.__div__ # doctest: +ELLIPSIS Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__div__' - >>> vs0_rdiv = vs0.__rdiv__ - Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__rdiv__' - >>> vs0_idiv = vs0.__idiv__ + AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__div__'... + >>> vs0_rdiv = vs0.__rdiv__ # doctest: +ELLIPSIS Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__idiv__' + AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__rdiv__'... + >>> vs0_idiv = vs0.__idiv__ # doctest: +ELLIPSIS + Traceback (most recent call last): + AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__idiv__'... + >>> # Python 3 does not use __oct__ or __hex__, so these methods are >>> # discarded under Python 3. - >>> vs0_oct = vs0.__oct__ + >>> vs0_oct = vs0.__oct__ # doctest: +ELLIPSIS Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__oct__' - >>> vs0_hex = vs0.__hex__ + AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__oct__'... + >>> vs0_hex = vs0.__hex__ # doctest: +ELLIPSIS Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__hex__' + AttributeError: 'special_methods_T561_py3.VerySpecial' object has no attribute '__hex__'... + >>> # Python 3 does not use __long__; if you define __long__ but not >>> # __int__, the __long__ definition will be used for __int__. - >>> Ll = Long().__long__ + >>> Ll = Long().__long__ # doctest: +ELLIPSIS Traceback (most recent call last): - ... - AttributeError: 'special_methods_T561_py3.Long' object has no attribute '__long__' + AttributeError: 'special_methods_T561_py3.Long' object has no attribute '__long__'... >>> Li = Long().__int__ >>> Li() Long __long__ - >>> # As of Python 3, defining __nonzero__ gives you a __bool__ method - >>> # instead. + + >>> # As of Python 3, defining __nonzero__ gives you a __bool__ method instead. >>> vs0_bool = vs0.__bool__ >>> vs0_bool() VS __nonzero__ 0