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 2021-04-24 23:06:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Cython (Old) and /work/SRC/openSUSE:Factory/.python-Cython.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Cython" Sat Apr 24 23:06:35 2021 rev:59 rq:887377 version:0.29.23 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Cython/python-Cython.changes 2021-03-02 15:25:53.753791890 +0100 +++ /work/SRC/openSUSE:Factory/.python-Cython.new.12324/python-Cython.changes 2021-04-24 23:06:38.571181817 +0200 @@ -1,0 +2,14 @@ +Wed Apr 21 21:19:17 UTC 2021 - Dirk M??ller <[email protected]> + +- update to 0.29.23: + * Some problems with Python 3.10 were resolved. + Patches by Victor Stinner and David Woods. (Github issues #4046, #4100) + * An incorrect "optimisation" was removed that allowed changes to a keyword + dict to leak into keyword arguments passed into a function. + Patch by Peng Weikang. (Github issue #3227) + * Multiplied str constants could end up as bytes constants with language_level=2. + Patch by Alphadelta14 and David Woods. (Github issue #3951) + * ``PY_SSIZE_T_CLEAN`` does not get defined any more if it is already defined. + Patch by Andrew Jones. (Github issue #4104) + +------------------------------------------------------------------- Old: ---- Cython-0.29.22.tar.gz New: ---- Cython-0.29.23.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Cython.spec ++++++ --- /var/tmp/diff_new_pack.gXaNWT/_old 2021-04-24 23:06:38.991182411 +0200 +++ /var/tmp/diff_new_pack.gXaNWT/_new 2021-04-24 23:06:38.991182411 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Cython -Version: 0.29.22 +Version: 0.29.23 Release: 0 Summary: The Cython compiler for writing C extensions for the Python language License: Apache-2.0 @@ -36,7 +36,7 @@ Requires: python-devel Requires: python-xml Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives %ifpython2 Provides: %{oldpython}-cython = %{version} Obsoletes: %{oldpython}-cython < %{version} ++++++ Cython-0.29.22.tar.gz -> Cython-0.29.23.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/.gitrev new/Cython-0.29.23/.gitrev --- old/Cython-0.29.22/.gitrev 2021-02-19 21:31:35.000000000 +0100 +++ new/Cython-0.29.23/.gitrev 2021-04-14 17:25:18.000000000 +0200 @@ -1 +1 @@ -fc777dd6f2661e9b34f50cbd39ac9b184eded484 +17670781083e3ccfedb1af4adcec614d4599eef9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/CHANGES.rst new/Cython-0.29.23/CHANGES.rst --- old/Cython-0.29.22/CHANGES.rst 2021-02-19 21:31:16.000000000 +0100 +++ new/Cython-0.29.23/CHANGES.rst 2021-04-14 17:24:45.000000000 +0200 @@ -2,6 +2,26 @@ Cython Changelog ================ +0.29.23 (2021-04-14) +==================== + +Bugs fixed +---------- + +* Some problems with Python 3.10 were resolved. + Patches by Victor Stinner and David Woods. (Github issues #4046, #4100) + +* An incorrect "optimisation" was removed that allowed changes to a keyword + dict to leak into keyword arguments passed into a function. + Patch by Peng Weikang. (Github issue #3227) + +* Multiplied str constants could end up as bytes constants with language_level=2. + Patch by Alphadelta14 and David Woods. (Github issue #3951) + +* ``PY_SSIZE_T_CLEAN`` does not get defined any more if it is already defined. + Patch by Andrew Jones. (Github issue #4104) + + 0.29.22 (2021-02-20) ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Build/Inline.py new/Cython-0.29.23/Cython/Build/Inline.py --- old/Cython-0.29.22/Cython/Build/Inline.py 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/Cython/Build/Inline.py 2021-04-14 17:24:45.000000000 +0200 @@ -35,14 +35,18 @@ else: to_unicode = lambda x: x -if sys.version_info[:2] < (3, 3): +if sys.version_info < (3, 5): import imp def load_dynamic(name, module_path): return imp.load_dynamic(name, module_path) else: - from importlib.machinery import ExtensionFileLoader + import importlib.util as _importlib_util def load_dynamic(name, module_path): - return ExtensionFileLoader(name, module_path).load_module() + spec = _importlib_util.spec_from_file_location(name, module_path) + module = _importlib_util.module_from_spec(spec) + # sys.modules[name] = module + spec.loader.exec_module(module) + return module class UnboundSymbols(EnvTransform, SkipDeclarations): def __init__(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Compiler/ExprNodes.py new/Cython-0.29.23/Cython/Compiler/ExprNodes.py --- old/Cython-0.29.22/Cython/Compiler/ExprNodes.py 2021-02-19 21:31:16.000000000 +0100 +++ new/Cython-0.29.23/Cython/Compiler/ExprNodes.py 2021-04-14 17:24:45.000000000 +0200 @@ -6669,22 +6669,13 @@ return dict_type def analyse_types(self, env): - args = [ + self.keyword_args = [ arg.analyse_types(env).coerce_to_pyobject(env).as_none_safe_node( # FIXME: CPython's error message starts with the runtime function name 'argument after ** must be a mapping, not NoneType') for arg in self.keyword_args ] - if len(args) == 1 and args[0].type is dict_type: - # strip this intermediate node and use the bare dict - arg = args[0] - if arg.is_name and arg.entry.is_arg and len(arg.entry.cf_assignments) == 1: - # passing **kwargs through to function call => allow NULL - arg.allow_null = True - return arg - - self.keyword_args = args return self def may_be_none(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Compiler/ModuleNode.py new/Cython-0.29.23/Cython/Compiler/ModuleNode.py --- old/Cython-0.29.22/Cython/Compiler/ModuleNode.py 2021-02-19 21:31:16.000000000 +0100 +++ new/Cython-0.29.23/Cython/Compiler/ModuleNode.py 2021-04-14 17:24:45.000000000 +0200 @@ -634,7 +634,10 @@ code.putln(json.dumps(metadata, indent=4, sort_keys=True)) code.putln("END: Cython Metadata */") code.putln("") + + code.putln("#ifndef PY_SSIZE_T_CLEAN") code.putln("#define PY_SSIZE_T_CLEAN") + code.putln("#endif /* PY_SSIZE_T_CLEAN */") for inc in sorted(env.c_includes.values(), key=IncludeCode.sortkey): if inc.location == inc.INITIAL: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Compiler/Optimize.py new/Cython-0.29.23/Cython/Compiler/Optimize.py --- old/Cython-0.29.22/Cython/Compiler/Optimize.py 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/Cython/Compiler/Optimize.py 2021-04-14 17:24:45.000000000 +0200 @@ -4251,6 +4251,7 @@ string_node.unicode_value = encoded_string( string_node.unicode_value * multiplier, string_node.unicode_value.encoding) + build_string = encoded_string if string_node.value.is_unicode else bytes_literal elif isinstance(string_node, ExprNodes.UnicodeNode): if string_node.bytes_value is not None: string_node.bytes_value = bytes_literal( @@ -4258,9 +4259,14 @@ string_node.bytes_value.encoding) else: assert False, "unknown string node type: %s" % type(string_node) - string_node.constant_result = string_node.value = build_string( + string_node.value = build_string( string_node.value * multiplier, string_node.value.encoding) + # follow constant-folding and use unicode_value in preference + if isinstance(string_node, ExprNodes.StringNode) and string_node.unicode_value is not None: + string_node.constant_result = string_node.unicode_value + else: + string_node.constant_result = string_node.value return string_node def _calculate_constant_seq(self, node, sequence_node, factor): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Compiler/TreePath.py new/Cython-0.29.23/Cython/Compiler/TreePath.py --- old/Cython-0.29.22/Cython/Compiler/TreePath.py 2020-04-19 11:26:03.000000000 +0200 +++ new/Cython-0.29.23/Cython/Compiler/TreePath.py 2021-04-14 17:24:45.000000000 +0200 @@ -10,6 +10,12 @@ import re import operator +import sys + +if sys.version_info[0] >= 3: + _unicode = str +else: + _unicode = unicode path_tokenizer = re.compile( r"(" @@ -167,6 +173,11 @@ continue if attr_value == value: yield attr_value + elif (isinstance(attr_value, bytes) and isinstance(value, _unicode) and + attr_value == value.encode()): + # allow a bytes-to-string comparison too + yield attr_value + return select diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Shadow.py new/Cython-0.29.23/Cython/Shadow.py --- old/Cython-0.29.22/Cython/Shadow.py 2021-02-19 21:31:16.000000000 +0100 +++ new/Cython-0.29.23/Cython/Shadow.py 2021-04-14 17:24:45.000000000 +0200 @@ -1,7 +1,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.29.22" +__version__ = "0.29.23" try: from __builtin__ import basestring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Cython/Utility/Builtins.c new/Cython-0.29.23/Cython/Utility/Builtins.c --- old/Cython-0.29.22/Cython/Utility/Builtins.c 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/Cython/Utility/Builtins.c 2021-04-14 17:24:45.000000000 +0200 @@ -496,9 +496,9 @@ result = PyFrozenSet_New(it); if (unlikely(!result)) return NULL; - if (likely(PySet_GET_SIZE(result))) + if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result))) return result; - // empty frozenset is a singleton + // empty frozenset is a singleton (on Python <3.10) // seems wasteful, but CPython does the same Py_DECREF(result); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/Demos/embed/Makefile new/Cython-0.29.23/Demos/embed/Makefile --- old/Cython-0.29.22/Demos/embed/Makefile 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/Demos/embed/Makefile 2021-04-14 17:24:45.000000000 +0200 @@ -15,6 +15,23 @@ LIBS := $(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'))") SYSLIBS := $(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SYSLIBS'))") +.PHONY: paths all clean test + +paths: + @echo "PYTHON=$(PYTHON)" + @echo "PYVERSION=$(PYVERSION)" + @echo "PYPREFIX=$(PYPREFIX)" + @echo "INCDIR=$(INCDIR)" + @echo "PLATINCDIR=$(PLATINCDIR)" + @echo "LIBDIR1=$(LIBDIR1)" + @echo "LIBDIR2=$(LIBDIR2)" + @echo "PYLIB=$(PYLIB)" + @echo "CC=$(CC)" + @echo "LINKCC=$(LINKCC)" + @echo "LINKFORSHARED=$(LINKFORSHARED)" + @echo "LIBS=$(LIBS)" + @echo "SYSLIBS=$(SYSLIBS)" + embedded: embedded.o $(LINKCC) -o $@ $^ -L$(LIBDIR1) -L$(LIBDIR2) -l$(PYLIB) $(LIBS) $(SYSLIBS) $(LINKFORSHARED) @@ -32,5 +49,5 @@ @rm -f *~ *.o *.so core core.* *.c embedded test.output test: clean all - PYTHONHOME=$(PYPREFIX) LD_LIBRARY_PATH=$(LIBDIR1):$$LD_LIBRARY_PATH ./embedded > test.output + LD_LIBRARY_PATH=$(LIBDIR1):$$LD_LIBRARY_PATH ./embedded > test.output $(PYTHON) assert_equal.py embedded.output test.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/PKG-INFO new/Cython-0.29.23/PKG-INFO --- old/Cython-0.29.22/PKG-INFO 2021-02-19 21:31:42.000000000 +0100 +++ new/Cython-0.29.23/PKG-INFO 2021-04-14 17:25:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: Cython -Version: 0.29.22 +Version: 0.29.23 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. @@ -44,6 +44,7 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 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.22/runtests.py new/Cython-0.29.23/runtests.py --- old/Cython-0.29.22/runtests.py 2021-02-19 21:31:16.000000000 +0100 +++ new/Cython-0.29.23/runtests.py 2021-04-14 17:24:45.000000000 +0200 @@ -432,6 +432,7 @@ INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ] CFLAGS = os.getenv('CFLAGS', '').split() CCACHE = os.getenv('CYTHON_RUNTESTS_CCACHE', '').split() +CDEFS = [] TEST_SUPPORT_DIR = 'testsupport' BACKENDS = ['c', 'cpp'] @@ -592,7 +593,7 @@ if not self.test_times: return lines = ['Times:\n'] - for metric, t in sorted(self.test_times.items()): + for metric, t in sorted(self.test_times.items(), key=operator.itemgetter(1), reverse=True): count = self.test_counts[metric] top = self.top_tests[metric] lines.append("%-12s: %8.2f sec (%4d, %6.3f / run) - slowest: %s\n" % ( @@ -1052,6 +1053,7 @@ build_extension.compiler = COMPILER ext_compile_flags = CFLAGS[:] + ext_compile_defines = CDEFS[:] if build_extension.compiler == 'mingw32': ext_compile_flags.append('-Wno-format') @@ -1066,6 +1068,7 @@ module, sources=self.source_files(workdir, module, related_files), extra_compile_args=ext_compile_flags, + define_macros=ext_compile_defines, **extra_extension_args ) @@ -1794,12 +1797,20 @@ if sys.version_info[0] >=3 and CY3_DIR: cython = os.path.join(CY3_DIR, cython) cython = os.path.abspath(os.path.join('..', '..', cython)) - self.assertEqual(0, os.system( - "make PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir))) + try: - os.remove('make.output') - except OSError: - pass + subprocess.check_call([ + "make", + "PYTHON='%s'" % sys.executable, + "CYTHON='%s'" % cython, + "LIBDIR1='%s'" % libdir, + "paths", "test", + ]) + except subprocess.CalledProcessError as err: + print(err.output.decode()) + raise + self.assertTrue(True) # :) + class MissingDependencyExcluder(object): @@ -2134,14 +2145,16 @@ import multiprocessing pool = multiprocessing.Pool(options.shard_count) tasks = [(options, cmd_args, shard_num) for shard_num in range(options.shard_count)] - errors = [] + error_shards = [] + failure_outputs = [] # NOTE: create process pool before time stamper thread to avoid forking issues. total_time = time.time() stats = Stats() with time_stamper_thread(): - for shard_num, shard_stats, return_code in pool.imap_unordered(runtests_callback, tasks): + for shard_num, shard_stats, return_code, failure_output in pool.imap_unordered(runtests_callback, tasks): if return_code != 0: - errors.append(shard_num) + error_shards.append(shard_num) + failure_outputs.append(failure_output) sys.stderr.write("FAILED (%s/%s)\n" % (shard_num, options.shard_count)) sys.stderr.write("ALL DONE (%s/%s)\n" % (shard_num, options.shard_count)) stats.update(shard_stats) @@ -2149,14 +2162,16 @@ pool.join() total_time = time.time() - total_time sys.stderr.write("Sharded tests run in %d seconds (%.1f minutes)\n" % (round(total_time), total_time / 60.)) - if errors: - sys.stderr.write("Errors for shards %s\n" % ", ".join([str(e) for e in errors])) + if error_shards: + sys.stderr.write("Errors found in shards %s\n" % ", ".join([str(e) for e in error_shards])) + for failure_output in zip(error_shards, failure_outputs): + sys.stderr.write("\nErrors from shard %s:\n%s" % failure_output) return_code = 1 else: return_code = 0 else: with time_stamper_thread(): - _, stats, return_code = runtests(options, cmd_args, coverage) + _, stats, return_code, _ = runtests(options, cmd_args, coverage) if coverage: if options.shard_count > 1 and options.shard_num == -1: @@ -2306,7 +2321,7 @@ build_in_temp=True, pyxbuild_dir=os.path.join(WORKDIR, "support")) sys.path.insert(0, os.path.split(libpath)[0]) - CFLAGS.append("-DCYTHON_REFNANNY=1") + CDEFS.append(('CYTHON_REFNANNY', '1')) if xml_output_dir and options.fork: # doesn't currently work together @@ -2501,10 +2516,27 @@ import refnanny sys.stderr.write("\n".join([repr(x) for x in refnanny.reflog])) - if options.exit_ok: - return options.shard_num, stats, 0 + result_code = 0 if options.exit_ok else not result.wasSuccessful() + + if xml_output_dir: + failure_output = "" else: - return options.shard_num, stats, not result.wasSuccessful() + failure_output = "".join(collect_failure_output(result)) + + return options.shard_num, stats, result_code, failure_output + + +def collect_failure_output(result): + """Extract test error/failure output from a TextTestResult.""" + failure_output = [] + for flavour, errors in (("ERROR", result.errors), ("FAIL", result.failures)): + for test, err in errors: + failure_output.append("%s\n%s: %s\n%s\n%s\n" % ( + result.separator1, + flavour, result.getDescription(test), + result.separator2, + err)) + return failure_output if __name__ == '__main__': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/setup.py new/Cython-0.29.23/setup.py --- old/Cython-0.29.22/setup.py 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/setup.py 2021-02-19 21:57:49.000000000 +0100 @@ -272,6 +272,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "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.22/tests/run/cpdef_enums.pyx new/Cython-0.29.23/tests/run/cpdef_enums.pyx --- old/Cython-0.29.22/tests/run/cpdef_enums.pyx 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/tests/run/cpdef_enums.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -33,10 +33,10 @@ Traceback (most recent call last): NameError: ...name 'RANK_3' is not defined ->>> set(PyxEnum) == set([TWO, THREE, FIVE]) +>>> set(PyxEnum) == {TWO, THREE, FIVE} True ->>> str(PyxEnum.TWO) -'PyxEnum.TWO' +>>> str(PyxEnum.TWO).split(".")[-1] # Py3.10 changed the output here +'TWO' >>> PyxEnum.TWO + PyxEnum.THREE == PyxEnum.FIVE True >>> PyxEnum(2) is PyxEnum["TWO"] is PyxEnum.TWO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/cstringmul.pyx new/Cython-0.29.23/tests/run/cstringmul.pyx --- old/Cython-0.29.22/tests/run/cstringmul.pyx 2018-09-22 16:18:56.000000000 +0200 +++ new/Cython-0.29.23/tests/run/cstringmul.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -31,3 +31,15 @@ uspam = u"eggs" * 4 ugrail = 7 * u"tomato" ugrail_long = 700 * u"tomato" + +cimport cython + [email protected]_assert_path_exists("//StringNode[@value = '-----']") [email protected]_assert_path_exists("//StringNode[@unicode_value = '-----']") +def gh3951(): + """ + Bug occurs with language_level=2 and affects StringNode.value + >>> gh3951() + '-----' + """ + return "-"*5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/dict.pyx new/Cython-0.29.23/tests/run/dict.pyx --- old/Cython-0.29.22/tests/run/dict.pyx 2015-09-10 18:25:36.000000000 +0200 +++ new/Cython-0.29.23/tests/run/dict.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -117,3 +117,22 @@ [2, 4, 5] """ return {1:2, sideeffect(2): 3, 3: 4, unhashable(4): 5, sideeffect(5): 6} + + +def dict_unpacking_not_for_arg_create_a_copy(): + """ + >>> dict_unpacking_not_for_arg_create_a_copy() + [('a', 'modified'), ('b', 'original')] + [('a', 'original'), ('b', 'original')] + """ + data = {'a': 'original', 'b': 'original'} + + func = lambda: {**data} + + call_once = func() + call_once['a'] = 'modified' + + call_twice = func() + + print(sorted(call_once.items())) + print(sorted(call_twice.items())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/generators_py35.py new/Cython-0.29.23/tests/run/generators_py35.py --- old/Cython-0.29.22/tests/run/generators_py35.py 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/tests/run/generators_py35.py 2021-04-14 17:24:45.000000000 +0200 @@ -30,10 +30,10 @@ >>> next(gen) 2.0 >>> ret, arg = sorted(anno_gen.__annotations__.items()) - >>> print(ret[0]); print(ret[1]) + >>> print(ret[0]); print(str(ret[1]).strip("'")) # strip makes it pass with/without PEP563 return float - >>> print(arg[0]); print(arg[1]) + >>> print(arg[0]); print(str(arg[1]).strip("'")) x int """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/kwargs_passthrough.pyx new/Cython-0.29.23/tests/run/kwargs_passthrough.pyx --- old/Cython-0.29.22/tests/run/kwargs_passthrough.pyx 2015-06-22 14:53:11.000000000 +0200 +++ new/Cython-0.29.23/tests/run/kwargs_passthrough.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -1,7 +1,6 @@ -cimport cython +import cython - [email protected]_fail_if_path_exists('//MergedDictNode') +#@cython.test_fail_if_path_exists('//MergedDictNode') def wrap_passthrough(f): """ >>> def f(a=1): return a @@ -80,7 +79,7 @@ return wrapper [email protected]_fail_if_path_exists('//MergedDictNode') +#@cython.test_fail_if_path_exists('//MergedDictNode') def wrap_passthrough2(f): """ >>> def f(a=1): return a @@ -99,7 +98,7 @@ return wrapper [email protected]_fail_if_path_exists('//MergedDictNode') +#@cython.test_fail_if_path_exists('//MergedDictNode') def wrap_modify(f): """ >>> def f(a=1, test=2): @@ -123,7 +122,7 @@ return wrapper [email protected]_fail_if_path_exists('//MergedDictNode') +#@cython.test_fail_if_path_exists('//MergedDictNode') def wrap_modify_mix(f): """ >>> def f(a=1, test=2): @@ -175,7 +174,21 @@ return wrapper [email protected]_assert_path_exists('//MergedDictNode') +def modify_in_function(): + """ + >>> modify_in_function() + {'foo': 'bar'} + {'foo': 'bar'} + """ + def inner(**kwds): + kwds['foo'] = 'modified' + d = {'foo': 'bar'} + print(d) + inner(**d) + print(d) + + +#@cython.test_assert_path_exists('//MergedDictNode') def wrap_modify_func_mix(f): """ >>> def f(a=1, test=2): @@ -203,12 +216,11 @@ return wrapper [email protected]_fail_if_path_exists('//MergedDictNode') +#@cython.test_fail_if_path_exists('//MergedDictNode') def wrap_reassign(f): """ >>> def f(a=1, test=2): ... return a, test - >>> wrapped = wrap_reassign(f) >>> wrapped(1) CALLED @@ -227,7 +239,7 @@ return wrapper [email protected]_fail_if_path_exists('//MergedDictNode') +#@cython.test_fail_if_path_exists('//MergedDictNode') def kwargs_metaclass(**kwargs): """ >>> K = kwargs_metaclass() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/powop.pyx new/Cython-0.29.23/tests/run/powop.pyx --- old/Cython-0.29.22/tests/run/powop.pyx 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/tests/run/powop.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -153,9 +153,9 @@ 0.5 >>> optimised_pow2_inplace(0.5) == 2 ** 0.5 True - >>> optimised_pow2_inplace('test') + >>> optimised_pow2_inplace('test') #doctest: +ELLIPSIS Traceback (most recent call last): - TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str' + TypeError: unsupported operand type(s) for ...: 'int' and 'str' """ x = 2 x **= n diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/set.pyx new/Cython-0.29.23/tests/run/set.pyx --- old/Cython-0.29.22/tests/run/set.pyx 2018-09-22 16:18:56.000000000 +0200 +++ new/Cython-0.29.23/tests/run/set.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -417,7 +417,8 @@ True >>> len(s) 0 - >>> s is frozenset() # singleton! + >>> import sys + >>> sys.version_info >= (3, 10) or s is frozenset() # singleton (in Python < 3.10)! True """ return frozenset() @@ -430,7 +431,8 @@ ) def test_singleton_empty_frozenset(): """ - >>> test_singleton_empty_frozenset() # from CPython's test_set.py + >>> import sys + >>> test_singleton_empty_frozenset() if sys.version_info < (3, 10) else 1 # from CPython's test_set.py 1 """ f = frozenset() @@ -438,7 +440,7 @@ frozenset(), frozenset([]), frozenset(()), frozenset(''), frozenset(range(0)), frozenset(frozenset()), frozenset(f), f] - return len(set(map(id, efs))) + return len(set(map(id, efs))) # note, only a singleton in Python <3.10 def sorted(it): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/test_asyncgen.py new/Cython-0.29.23/tests/run/test_asyncgen.py --- old/Cython-0.29.22/tests/run/test_asyncgen.py 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/tests/run/test_asyncgen.py 2021-04-14 17:24:45.000000000 +0200 @@ -501,9 +501,9 @@ def test_async_gen_asyncio_01(self): async def gen(): yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) return yield 3 @@ -513,7 +513,7 @@ def test_async_gen_asyncio_02(self): async def gen(): yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 2 1 / ZERO yield 3 @@ -527,7 +527,7 @@ class Gen: async def __aiter__(self): yield 1 - await asyncio.sleep(0.01, loop=loop) + await asyncio.sleep(0.01) yield 2 res = loop.run_until_complete(self.to_list(Gen())) @@ -536,13 +536,13 @@ def test_async_gen_asyncio_anext_04(self): async def foo(): yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) try: yield 2 yield 3 except ZeroDivisionError: yield 1000 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 4 async def run1(): @@ -693,7 +693,7 @@ yield 1 1 / ZERO finally: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield 12 async def run(): @@ -716,8 +716,8 @@ yield 1 1 / ZERO finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE += 1 DONE += 1000 @@ -743,8 +743,8 @@ DONE += 1000 yield 2 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE += 1 DONE += 1000 @@ -753,7 +753,7 @@ it = gen.__aiter__() self.assertEqual(await it.__anext__(), 1) t = self.loop.create_task(it.__anext__()) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) await gen.aclose() return t @@ -763,7 +763,7 @@ # Silence ResourceWarnings fut.cancel() t.cancel() - self.loop.run_until_complete(asyncio.sleep(0.01, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.01)) @needs_py36_asyncio def test_async_gen_asyncio_gc_aclose_09(self): @@ -775,8 +775,8 @@ while True: yield 1 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -785,7 +785,7 @@ await g.__anext__() del g - await asyncio.sleep(0.1, loop=self.loop) + await asyncio.sleep(0.1) self.loop.run_until_complete(run()) self.assertEqual(DONE, 1) @@ -876,15 +876,15 @@ async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) v = yield 1 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield v * 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) return finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -906,21 +906,21 @@ DONE = 0 async def sleep_n_crash(delay): - await asyncio.sleep(delay, loop=self.loop) + await asyncio.sleep(delay) 1 / ZERO async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) v = yield 1 await sleep_n_crash(0.01) DONE += 1000 yield v * 2 finally: assert sys.exc_info()[0] == ZeroDivisionError - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE += 1 async def run(): @@ -939,7 +939,7 @@ DONE = 0 async def sleep_n_crash(delay): - fut = asyncio.ensure_future(asyncio.sleep(delay, loop=self.loop), + fut = asyncio.ensure_future(asyncio.sleep(delay), loop=self.loop) self.loop.call_later(delay / 2, lambda: fut.cancel()) return await fut @@ -947,14 +947,14 @@ async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) v = yield 1 await sleep_n_crash(0.01) DONE += 1000 yield v * 2 finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -993,18 +993,18 @@ async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) try: v = yield 1 except FooEr: v = 1000 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) yield v * 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) # return finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -1029,7 +1029,7 @@ pass async def sleep_n_crash(delay): - fut = asyncio.ensure_future(asyncio.sleep(delay, loop=self.loop), + fut = asyncio.ensure_future(asyncio.sleep(delay), loop=self.loop) self.loop.call_later(delay / 2, lambda: fut.cancel()) return await fut @@ -1037,17 +1037,17 @@ async def gen(): nonlocal DONE try: - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) try: v = yield 1 except FooEr: await sleep_n_crash(0.01) yield v * 2 - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) # return finally: - await asyncio.sleep(0.01, loop=self.loop) - await asyncio.sleep(0.01, loop=self.loop) + await asyncio.sleep(0.01) + await asyncio.sleep(0.01) DONE = 1 async def run(): @@ -1147,10 +1147,10 @@ async def waiter(timeout): nonlocal finalized try: - await asyncio.sleep(timeout, loop=self.loop) + await asyncio.sleep(timeout) yield 1 finally: - await asyncio.sleep(0, loop=self.loop) + await asyncio.sleep(0) finalized += 1 async def wait(): @@ -1160,7 +1160,7 @@ t1 = self.loop.create_task(wait()) t2 = self.loop.create_task(wait()) - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) self.loop.run_until_complete(self.loop.shutdown_asyncgens()) self.assertEqual(finalized, 2) @@ -1168,7 +1168,7 @@ # Silence warnings t1.cancel() t2.cancel() - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) @needs_py36_asyncio def test_async_gen_asyncio_shutdown_02(self): @@ -1183,7 +1183,7 @@ async def waiter(timeout): try: - await asyncio.sleep(timeout, loop=self.loop) + await asyncio.sleep(timeout) yield 1 finally: 1 / ZERO @@ -1193,7 +1193,7 @@ pass t = self.loop.create_task(wait()) - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) self.loop.set_exception_handler(logger) self.loop.run_until_complete(self.loop.shutdown_asyncgens()) @@ -1202,7 +1202,7 @@ # Silence warnings t.cancel() - self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop)) + self.loop.run_until_complete(asyncio.sleep(0.1)) if __name__ == "__main__": unittest.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/test_exceptions.pyx new/Cython-0.29.23/tests/run/test_exceptions.pyx --- old/Cython-0.29.22/tests/run/test_exceptions.pyx 2020-04-19 11:26:03.000000000 +0200 +++ new/Cython-0.29.23/tests/run/test_exceptions.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -13,11 +13,16 @@ import weakref import errno -from test.support import (TESTFN, captured_stderr, check_impl_detail, - check_warnings, gc_collect, +from test.support import (captured_stderr, check_impl_detail, gc_collect, # no_tracing, cpython_only, - unlink, import_module, script_helper, - SuppressCrashReport) + script_helper, SuppressCrashReport) +try: + from test.support.os_helper import TESTFN, unlink + from test.support.warnings_helper import check_warnings + from test.support.import_helper import import_module +except ImportError: + # Python 3.9 and older + from test.support import check_warnings, TESTFN, unlink, import_module no_tracing = unittest.skip("For nested functions, Cython generates a C call without recursion checks.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.22/tests/run/test_unicode.pyx new/Cython-0.29.23/tests/run/test_unicode.pyx --- old/Cython-0.29.22/tests/run/test_unicode.pyx 2020-08-14 10:31:39.000000000 +0200 +++ new/Cython-0.29.23/tests/run/test_unicode.pyx 2021-04-14 17:24:45.000000000 +0200 @@ -1470,19 +1470,19 @@ class Str(str, enum.Enum): ABC = 'abc' # Testing Unicode formatting strings... - self.assertEqual("%s, %s" % (Str.ABC, Str.ABC), - 'Str.ABC, Str.ABC') - self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" % + self.assertEqual(("%s, %s" % (Str.ABC, Str.ABC)).replace("Str.", ""), + 'ABC, ABC') + self.assertEqual(("%s, %s, %d, %i, %u, %f, %5.2f" % (Str.ABC, Str.ABC, Int.IDES, Int.IDES, Int.IDES, - Float.PI, Float.PI), - 'Str.ABC, Str.ABC, 15, 15, 15, 3.141593, 3.14') + Float.PI, Float.PI)).replace("Str.", ""), + 'ABC, ABC, 15, 15, 15, 3.141593, 3.14') # formatting jobs delegated from the string implementation: - self.assertEqual('...%(foo)s...' % {'foo':Str.ABC}, - '...Str.ABC...') - self.assertEqual('...%(foo)s...' % {'foo':Int.IDES}, - '...Int.IDES...') + self.assertEqual(('...%(foo)s...' % {'foo':Str.ABC}).replace("Str.", ""), + '...ABC...') + self.assertEqual(('...%(foo)s...' % {'foo':Int.IDES}).replace("Int.", ""), + '...IDES...') self.assertEqual('...%(foo)i...' % {'foo':Int.IDES}, '...15...') self.assertEqual('...%(foo)d...' % {'foo':Int.IDES},
