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 2022-08-03 21:16:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Cython (Old)
 and      /work/SRC/openSUSE:Factory/.python-Cython.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Cython"

Wed Aug  3 21:16:29 2022 rev:66 rq:992334 version:0.29.32

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Cython/python-Cython.changes      
2022-05-20 17:50:20.847205573 +0200
+++ /work/SRC/openSUSE:Factory/.python-Cython.new.1533/python-Cython.changes    
2022-08-03 21:16:38.771433911 +0200
@@ -1,0 +2,35 @@
+Tue Aug  2 11:51:50 UTC 2022 - Otto Hollmann <otto.hollm...@suse.com>
+
+- Update to 0.29.32:
+  - Bugs fixed:
+    * Revert "Using memoryview typed arguments in inner functions is now
+      rejected as unsupported."
+    * from module import * failed in 0.29.31 when using memoryviews
+- Changes from 0.29.31:
+  - Features added:
+    * A new argument --module-name was added to the cython command to provide
+      the (one) exact target module name from the command line.
+  - Bugs fixed:
+    * Use importlib.util.find_spec() instead of the deprecated
+      importlib.find_loader() function when setting up the package path at
+      import-time.
+    * Require the C compiler to support the two-arg form of va_start on
+      Python 3.10 and higher.
+    * Make fused_type subscriptable in Shadow.py.
+    * Fix the incorrect code generation of the target type in bytearray loops.
+    * Atomic refcounts for memoryviews were not used on some GCC versions by
+      accident.
+    * Silence some GCC -Wconversion warnings in C utility code.
+    * Tuple multiplication was ignored in expressions such as [*(1,) * 2].
+    * Calling append methods on extension types could fail to find the method 
in
+      some cases.
+    * Ensure that object buffers (e.g. ndarray[object, ndim=1]) containing NULL
+      pointers are safe to use, returning None instead of the NULL pointer.
+    * Using memoryview typed arguments in inner functions is now rejected as
+      unsupported.
+    * Compilation could fail on systems (e.g. FIPS) that block MD5 checksums at
+      runtime.
+    * Experimental adaptations for the CPython "nogil" fork was added. Note 
that
+      there is no official support for this in Cython 0.x.
+
+-------------------------------------------------------------------

Old:
----
  Cython-0.29.30.tar.gz

New:
----
  Cython-0.29.32.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-Cython.spec ++++++
--- /var/tmp/diff_new_pack.SLllLa/_old  2022-08-03 21:16:39.319435349 +0200
+++ /var/tmp/diff_new_pack.SLllLa/_new  2022-08-03 21:16:39.323435359 +0200
@@ -20,7 +20,7 @@
 %define         oldpython python
 %bcond_with test
 Name:           python-Cython
-Version:        0.29.30
+Version:        0.29.32
 Release:        0
 Summary:        The Cython compiler for writing C extensions for the Python 
language
 License:        Apache-2.0

++++++ Cython-0.29.30.tar.gz -> Cython-0.29.32.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/.gitrev new/Cython-0.29.32/.gitrev
--- old/Cython-0.29.30/.gitrev  2022-05-17 18:38:40.361280000 +0200
+++ new/Cython-0.29.32/.gitrev  2022-07-29 08:30:29.283721200 +0200
@@ -1 +1 @@
-a6f04ef2430fb4e7383a068cd1ae9a115d7a78df
+c48361d0a0969206e227ec016f654c9d941c2b69
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/CHANGES.rst 
new/Cython-0.29.32/CHANGES.rst
--- old/Cython-0.29.30/CHANGES.rst      2022-05-17 18:38:34.117270200 +0200
+++ new/Cython-0.29.32/CHANGES.rst      2022-07-29 08:30:24.199703500 +0200
@@ -2,6 +2,75 @@
 Cython Changelog
 ================
 
+0.29.32 (2022-07-29)
+====================
+
+Bugs fixed
+----------
+
+* Revert "Using memoryview typed arguments in inner functions is now rejected 
as unsupported."
+  Patch by David Woods.  (Github issue #4798)
+
+* ``from module import *`` failed in 0.29.31 when using memoryviews.
+  Patch by David Woods.  (Github issue #4927)
+
+
+0.29.31 (2022-07-27)
+====================
+
+Features added
+--------------
+
+* 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)
+
+Bugs fixed
+----------
+
+* Use ``importlib.util.find_spec()`` instead of the deprecated 
``importlib.find_loader()``
+  function when setting up the package path at import-time.
+  Patch by Matti Picus.  (Github issue #4764)
+
+* Require the C compiler to support the two-arg form of ``va_start``
+  on Python 3.10 and higher.
+  Patch by Thomas Caswell.  (Github issue #4820)
+
+* Make ``fused_type`` subscriptable in Shadow.py.
+  Patch by Pfebrer.  (Github issue #4842)
+
+* Fix the incorrect code generation of the target type in ``bytearray`` loops.
+  Patch by Kenrick Everett.  (Github issue #4108)
+
+* Atomic refcounts for memoryviews were not used on some GCC versions by 
accident.
+  Patch by Sam Gross.  (Github issue #4915)
+
+* Silence some GCC ``-Wconversion`` warnings in C utility code.
+  Patch by Lisandro Dalcin.  (Github issue #4854)
+
+* Tuple multiplication was ignored in expressions such as ``[*(1,) * 2]``.
+  Patch by David Woods.  (Github issue #4864)
+
+* Calling ``append`` methods on extension types could fail to find the method
+  in some cases.
+  Patch by David Woods.  (Github issue #4828)
+
+* Ensure that object buffers (e.g. ``ndarray[object, ndim=1]``) containing
+  ``NULL``  pointers are safe to use, returning ``None`` instead of the 
``NULL``
+  pointer.
+  Patch by Sebastian Berg.  (Github issue #4859)
+
+* Using memoryview typed arguments in inner functions is now rejected as 
unsupported.
+  Patch by David Woods.  (Github issue #4798)
+
+* Compilation could fail on systems (e.g. FIPS) that block MD5 checksums at 
runtime.
+  (Github issue #4909)
+
+* Experimental adaptations for the CPython "nogil" fork was added.
+  Note that there is no official support for this in Cython 0.x.
+  Patch by Sam Gross.  (Github issue #4912)
+
+
 0.29.30 (2022-05-16)
 ====================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/CmdLine.py 
new/Cython-0.29.32/Cython/Compiler/CmdLine.py
--- old/Cython-0.29.30/Cython/Compiler/CmdLine.py       2022-05-17 
18:38:34.121270200 +0200
+++ new/Cython-0.29.32/Cython/Compiler/CmdLine.py       2022-07-29 
08:30:24.199703500 +0200
@@ -50,6 +50,9 @@
   --warning-extra, -Wextra       Enable extra warnings
   -X, --directive <name>=<value>[,<name=value,...] Overrides a compiler 
directive
   -E, --compile-time-env name=value[,<name=value,...] Provides compile time 
env like DEF would do.
+  --module-name                  Fully qualified module name. If not given, it 
is deduced from the
+                                 import path if source file is in a package, 
or equals the
+                                 filename otherwise.
 """
 
 
@@ -190,6 +193,8 @@
                 except ValueError as e:
                     sys.stderr.write("Error in compile-time-env: %s\n" % 
e.args[0])
                     sys.exit(1)
+            elif option == "--module-name":
+                options.module_name = pop_value()
             elif option.startswith('--debug'):
                 option = option[2:].replace('-', '_')
                 from . import DebugFlags
@@ -202,6 +207,7 @@
                 sys.stdout.write(usage)
                 sys.exit(0)
             else:
+                sys.stderr.write(usage)
                 sys.stderr.write("Unknown compiler flag: %s\n" % option)
                 sys.exit(1)
         else:
@@ -218,7 +224,16 @@
         bad_usage()
     if Options.embed and len(sources) > 1:
         sys.stderr.write(
-            "cython: Only one source file allowed when using -embed\n")
+            "cython: Only one source file allowed when using --embed\n")
         sys.exit(1)
+    if options.module_name:
+        if options.timestamps:
+            sys.stderr.write(
+                "cython: Cannot use --module-name with --timestamps\n")
+            sys.exit(1)
+        if len(sources) > 1:
+            sys.stderr.write(
+                "cython: Only one source file allowed when using 
--module-name\n")
+            sys.exit(1)
     return options, sources
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/ExprNodes.py 
new/Cython-0.29.32/Cython/Compiler/ExprNodes.py
--- old/Cython-0.29.30/Cython/Compiler/ExprNodes.py     2022-05-17 
18:38:34.121270200 +0200
+++ new/Cython-0.29.32/Cython/Compiler/ExprNodes.py     2022-07-29 
08:30:24.203703600 +0200
@@ -306,8 +306,8 @@
     #                            Cached result of subexpr_nodes()
     #  use_managed_ref boolean   use ref-counted temps/assignments/etc.
     #  result_is_used  boolean   indicates that the result will be dropped and 
the
-    #  is_numpy_attribute   boolean   Is a Numpy module attribute
     #                            result_code/temp_result can safely be set to 
None
+    #  is_numpy_attribute   boolean   Is a Numpy module attribute
     #  annotation   ExprNode or None    PEP526 annotation for names or 
expressions
 
     result_ctype = None
@@ -2876,6 +2876,10 @@
             iterator_type = self.iterator.infer_type(env)
         if iterator_type.is_ptr or iterator_type.is_array:
             return iterator_type.base_type
+        elif self.iterator.sequence.type is bytearray_type:
+            # This is a temporary work-around to fix bytearray iteration in 
0.29.x
+            # It has been fixed properly in master, refer to ticket: 3473
+            return py_object_type
         elif iterator_type.is_cpp_class:
             item_type = env.lookup_operator_for_types(self.pos, "*", 
[iterator_type]).type.return_type
             if item_type.is_reference:
@@ -4347,17 +4351,17 @@
         buffer_entry, ptrexpr = self.buffer_lookup_code(code)
 
         if self.buffer_type.dtype.is_pyobject:
-            # Must manage refcounts. Decref what is already there
-            # and incref what we put in.
+            # Must manage refcounts. XDecref what is already there
+            # and incref what we put in (NumPy allows there to be NULL)
             ptr = code.funcstate.allocate_temp(buffer_entry.buf_ptr_type,
                                                manage_ref=False)
             rhs_code = rhs.result()
             code.putln("%s = %s;" % (ptr, ptrexpr))
-            code.put_gotref("*%s" % ptr)
-            code.putln("__Pyx_INCREF(%s); __Pyx_DECREF(*%s);" % (
+            code.put_xgotref("*%s" % ptr)
+            code.putln("__Pyx_INCREF(%s); __Pyx_XDECREF(*%s);" % (
                 rhs_code, ptr))
             code.putln("*%s %s= %s;" % (ptr, op, rhs_code))
-            code.put_giveref("*%s" % ptr)
+            code.put_xgiveref("*%s" % ptr)
             code.funcstate.release_temp(ptr)
         else:
             # Simple case
@@ -4378,8 +4382,11 @@
             # is_temp is True, so must pull out value and incref it.
             # NOTE: object temporary results for nodes are declared
             #       as PyObject *, so we need a cast
-            code.putln("%s = (PyObject *) *%s;" % (self.result(), 
self.buffer_ptr_code))
-            code.putln("__Pyx_INCREF((PyObject*)%s);" % self.result())
+            res = self.result()
+            code.putln("%s = (PyObject *) *%s;" % (res, self.buffer_ptr_code))
+            # NumPy does (occasionally) allow NULL to denote None.
+            code.putln("if (unlikely(%s == NULL)) %s = Py_None;" % (res, res))
+            code.putln("__Pyx_INCREF((PyObject*)%s);" % res)
 
     def free_subexpr_temps(self, code):
         for temp in self.index_temps:
@@ -8478,7 +8485,7 @@
         if type in (list_type, tuple_type) and args and 
args[0].is_sequence_constructor:
             # construct a list directly from the first argument that we can 
then extend
             if args[0].type is not list_type:
-                args[0] = ListNode(args[0].pos, args=args[0].args, 
is_temp=True)
+                args[0] = ListNode(args[0].pos, args=args[0].args, 
is_temp=True, mult_factor=args[0].mult_factor)
         ExprNode.__init__(self, pos, args=args, type=type)
 
     def calculate_constant_result(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/Main.py 
new/Cython-0.29.32/Cython/Compiler/Main.py
--- old/Cython-0.29.30/Cython/Compiler/Main.py  2022-05-17 18:38:34.125270100 
+0200
+++ new/Cython-0.29.32/Cython/Compiler/Main.py  2022-07-29 08:30:24.203703600 
+0200
@@ -735,6 +735,9 @@
     a CompilationResultSet. Performs timestamp checking and/or recursion
     if these are specified in the options.
     """
+    if options.module_name and len(sources) > 1:
+        raise RuntimeError('Full module name can only be set '
+                           'for single source compilation')
     # run_pipeline creates the context
     # context = options.create_context()
     sources = [os.path.abspath(source) for source in sources]
@@ -753,8 +756,9 @@
             if (not timestamps) or out_of_date:
                 if verbose:
                     sys.stderr.write("Compiling %s\n" % source)
-
-                result = run_pipeline(source, options, context=context)
+                result = run_pipeline(source, options,
+                                      full_module_name=options.module_name,
+                                      context=context)
                 results.add(source, result)
                 # Compiling multiple sources in one context doesn't quite
                 # work properly yet.
@@ -900,5 +904,6 @@
     build_dir=None,
     cache=None,
     create_extension=None,
+    module_name=None,
     np_pythran=False
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/ModuleNode.py 
new/Cython-0.29.32/Cython/Compiler/ModuleNode.py
--- old/Cython-0.29.30/Cython/Compiler/ModuleNode.py    2022-05-17 
18:38:34.125270100 +0200
+++ new/Cython-0.29.32/Cython/Compiler/ModuleNode.py    2022-07-29 
08:30:24.207703600 +0200
@@ -2628,18 +2628,12 @@
             # packages require __path__, so all we can do is try to figure
             # out the module path at runtime by rerunning the import lookup
             code.putln("if (!CYTHON_PEP489_MULTI_PHASE_INIT) {")
-            package_name, _ = self.full_module_name.rsplit('.', 1)
-            if '.' in package_name:
-                parent_name = '"%s"' % (package_name.rsplit('.', 1)[0],)
-            else:
-                parent_name = 'NULL'
             code.globalstate.use_utility_code(UtilityCode.load(
                 "SetPackagePathFromImportLib", "ImportExport.c"))
             code.putln(code.error_goto_if_neg(
-                '__Pyx_SetPackagePathFromImportLib(%s, %s)' % (
-                    parent_name,
+                '__Pyx_SetPackagePathFromImportLib(%s)' % (
                     code.globalstate.get_py_string_const(
-                        EncodedString(env.module_name)).cname),
+                        EncodedString(self.full_module_name)).cname),
                 self.pos))
             code.putln("}")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/Nodes.py 
new/Cython-0.29.32/Cython/Compiler/Nodes.py
--- old/Cython-0.29.30/Cython/Compiler/Nodes.py 2022-05-17 18:38:34.125270100 
+0200
+++ new/Cython-0.29.32/Cython/Compiler/Nodes.py 2022-07-29 08:30:24.207703600 
+0200
@@ -2637,8 +2637,11 @@
         def put_into_closure(entry):
             if entry.in_closure and not arg.default:
                 code.putln('%s = %s;' % (entry.cname, entry.original_cname))
-                code.put_var_incref(entry)
-                code.put_var_giveref(entry)
+                if entry.type.is_memoryviewslice:
+                    code.put_incref_memoryviewslice(entry.cname, have_gil=True)
+                else:
+                    code.put_var_incref(entry)
+                    code.put_var_giveref(entry)
         for arg in self.args:
             put_into_closure(scope.lookup_here(arg.name))
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/Optimize.py 
new/Cython-0.29.32/Cython/Compiler/Optimize.py
--- old/Cython-0.29.30/Cython/Compiler/Optimize.py      2022-05-17 
18:38:34.129270300 +0200
+++ new/Cython-0.29.32/Cython/Compiler/Optimize.py      2022-07-29 
08:30:24.207703600 +0200
@@ -2860,7 +2860,7 @@
         """Optimistic optimisation as X.append() is almost always
         referring to a list.
         """
-        if len(args) != 2 or node.result_is_used:
+        if len(args) != 2 or node.result_is_used or node.function.entry:
             return node
 
         return ExprNodes.PythonCapiCallNode(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.30/Cython/Compiler/ParseTreeTransforms.py 
new/Cython-0.29.32/Cython/Compiler/ParseTreeTransforms.py
--- old/Cython-0.29.30/Cython/Compiler/ParseTreeTransforms.py   2022-05-17 
18:38:34.129270300 +0200
+++ new/Cython-0.29.32/Cython/Compiler/ParseTreeTransforms.py   2022-07-29 
08:30:24.207703600 +0200
@@ -4,10 +4,12 @@
 cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, 
Nodes=object,
                Options=object, UtilNodes=object, LetNode=object,
                LetRefNode=object, TreeFragment=object, EncodedString=object,
-               error=object, warning=object, copy=object, _unicode=object)
+               error=object, warning=object, copy=object, hashlib=object, 
sys=object,
+               _unicode=object)
 
 import copy
 import hashlib
+import sys
 
 from . import PyrexTypes
 from . import Naming
@@ -1700,24 +1702,9 @@
                 if not e.type.is_pyobject:
                     e.type.create_to_py_utility_code(env)
                     e.type.create_from_py_utility_code(env)
-            all_members_names = sorted([e.name for e in all_members])
+            all_members_names = [e.name for e in all_members]
+            checksums = _calculate_pickle_checksums(all_members_names)
 
-            # Cython 0.x used MD5 for the checksum, which a few Python 
installations remove for security reasons.
-            # SHA-256 should be ok for years to come, but early Cython 3.0 
alpha releases used SHA-1,
-            # which may not be.
-            checksum_algos = []
-            try:
-                checksum_algos.append(hashlib.md5)
-            except AttributeError:
-                pass
-            checksum_algos.append(hashlib.sha256)
-            checksum_algos.append(hashlib.sha1)
-
-            member_names_string = ' '.join(all_members_names).encode('utf-8')
-            checksums = [
-                '0x' + mkchecksum(member_names_string).hexdigest()[:7]
-                for mkchecksum in checksum_algos
-            ]
             unpickle_func_name = '__pyx_unpickle_%s' % node.class_name
 
             # TODO(robertwb): Move the state into the third argument
@@ -2136,6 +2123,24 @@
         return property
 
 
+def _calculate_pickle_checksums(member_names):
+    # Cython 0.x used MD5 for the checksum, which a few Python installations 
remove for security reasons.
+    # SHA-256 should be ok for years to come, but early Cython 3.0 alpha 
releases used SHA-1,
+    # which may not be.
+    member_names_string = ' '.join(member_names).encode('utf-8')
+    hash_kwargs = {'usedforsecurity': False} if sys.version_info >= (3, 9) 
else {}
+    checksums = []
+    for algo_name in ['md5', 'sha256', 'sha1']:
+        try:
+            mkchecksum = getattr(hashlib, algo_name)
+            checksum = mkchecksum(member_names_string, 
**hash_kwargs).hexdigest()
+        except (AttributeError, ValueError):
+            # The algorithm (i.e. MD5) might not be there at all, or might be 
blocked at runtime.
+            continue
+        checksums.append('0x' + checksum[:7])
+    return checksums
+
+
 class CalculateQualifiedNamesTransform(EnvTransform):
     """
     Calculate and store the '__qualname__' and the global
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/Parsing.py 
new/Cython-0.29.32/Cython/Compiler/Parsing.py
--- old/Cython-0.29.30/Cython/Compiler/Parsing.py       2022-05-17 
18:38:34.129270300 +0200
+++ new/Cython-0.29.32/Cython/Compiler/Parsing.py       2022-07-29 
08:30:24.211703500 +0200
@@ -2820,6 +2820,8 @@
     s.expect(')')
     nogil = p_nogil(s)
     exc_val, exc_check = p_exception_value_clause(s)
+    # TODO - warning to enforce preferred exception specification order
+    nogil = nogil or p_nogil(s)
     with_gil = p_with_gil(s)
     return Nodes.CFuncDeclaratorNode(pos,
         base = base, args = args, has_varargs = ellipsis,
@@ -2938,7 +2940,11 @@
 def p_exception_value_clause(s):
     exc_val = None
     exc_check = 0
-    if s.sy == 'except':
+
+    if s.sy == 'IDENT' and s.systring == 'noexcept':
+        s.next()
+        exc_check = False  # No-op in Cython 0.29.x
+    elif s.sy == 'except':
         s.next()
         if s.sy == '*':
             exc_check = 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Compiler/Tests/TestCmdLine.py 
new/Cython-0.29.32/Cython/Compiler/Tests/TestCmdLine.py
--- old/Cython-0.29.30/Cython/Compiler/Tests/TestCmdLine.py     2022-05-17 
18:38:34.133270300 +0200
+++ new/Cython-0.29.32/Cython/Compiler/Tests/TestCmdLine.py     2022-07-29 
08:30:24.211703500 +0200
@@ -1,5 +1,6 @@
 
 import sys
+import re
 from unittest import TestCase
 try:
     from StringIO import StringIO
@@ -10,6 +11,18 @@
 from ..CmdLine import parse_command_line
 
 
+def check_global_options(expected_options, white_list=[]):
+    """
+    returns error message of "" if check Ok
+    """
+    no_value = object()
+    for name, orig_value in expected_options.items():
+        if name not in white_list:
+            if getattr(Options, name, no_value) != orig_value:
+                return "error in option " + name
+    return ""
+
+
 class CmdLineParserTest(TestCase):
     def setUp(self):
         backup = {}
@@ -23,6 +36,17 @@
             if getattr(Options, name, no_value) != orig_value:
                 setattr(Options, name, orig_value)
 
+    def check_default_global_options(self, white_list=[]):
+        self.assertEqual(check_global_options(self._options_backup, 
white_list), "")
+
+    def check_default_options(self, options, white_list=[]):
+        from ..Main import CompilationOptions, default_options
+        default_options = CompilationOptions(default_options)
+        no_value = object()
+        for name in default_options.__dict__.keys():
+            if name not in white_list:
+                self.assertEqual(getattr(options, name, no_value), 
getattr(default_options, name), msg="error in option " + name)
+
     def test_short_options(self):
         options, sources = parse_command_line([
             '-V', '-l', '-+', '-t', '-v', '-v', '-v', '-p', '-D', '-a', '-3',
@@ -98,21 +122,49 @@
         self.assertTrue(options.gdb_debug)
         self.assertEqual(options.output_dir, '/gdb/outdir')
 
+    def test_module_name(self):
+        options, sources = parse_command_line([
+            'source.pyx'
+        ])
+        self.assertEqual(options.module_name, None)
+        self.check_default_global_options()
+        self.check_default_options(options)
+        options, sources = parse_command_line([
+            '--module-name', 'foo.bar',
+            'source.pyx'
+        ])
+        self.assertEqual(options.module_name, 'foo.bar')
+        self.check_default_global_options()
+        self.check_default_options(options, ['module_name'])
+
     def test_errors(self):
-        def error(*args):
+        def error(args, regex=None):
             old_stderr = sys.stderr
             stderr = sys.stderr = StringIO()
             try:
                 self.assertRaises(SystemExit, parse_command_line, list(args))
             finally:
                 sys.stderr = old_stderr
-            self.assertTrue(stderr.getvalue())
-
-        error('-1')
-        error('-I')
-        error('--version=-a')
-        error('--version=--annotate=true')
-        error('--working')
-        error('--verbose=1')
-        error('--verbose=1')
-        error('--cleanup')
+            msg = stderr.getvalue().strip()
+            self.assertTrue(msg)
+            if regex:
+                self.assertTrue(re.search(regex, msg),
+                                '"%s" does not match search "%s"' %
+                                (msg, regex))
+
+        error(['-1'],
+              'Unknown compiler flag: -1')
+        error(['-I'])
+        error(['--version=-a'])
+        error(['--version=--annotate=true'])
+        error(['--working'])
+        error(['--verbose=1'])
+        error(['--cleanup'])
+        error(['--debug-disposal-code-wrong-name', 'file3.pyx'],
+              "Unknown debug flag: debug_disposal_code_wrong_name")
+        error(['--module-name', 'foo.pyx'])
+        error(['--module-name', 'foo.bar'])
+        error(['--module-name', 'foo.bar', 'foo.pyx', 'bar.pyx'],
+              "Only one source file allowed when using --module-name")
+        error(['--module-name', 'foo.bar', '--timestamps', 'foo.pyx'],
+              "Cannot use --module-name with --timestamps")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.30/Cython/Compiler/Tests/TestParseTreeTransforms.py 
new/Cython-0.29.32/Cython/Compiler/Tests/TestParseTreeTransforms.py
--- old/Cython-0.29.30/Cython/Compiler/Tests/TestParseTreeTransforms.py 
2022-05-17 18:38:34.133270300 +0200
+++ new/Cython-0.29.32/Cython/Compiler/Tests/TestParseTreeTransforms.py 
2022-07-29 08:30:24.211703500 +0200
@@ -1,7 +1,9 @@
-import os
+import os.path
+import unittest
 
 from Cython.TestUtils import TransformTest
 from Cython.Compiler.ParseTreeTransforms import *
+from Cython.Compiler.ParseTreeTransforms import _calculate_pickle_checksums
 from Cython.Compiler.Nodes import *
 from Cython.Compiler import Main, Symtab
 
@@ -276,6 +278,11 @@
             raise
 
 
+class TestAnalyseDeclarationsTransform(unittest.TestCase):
+    def test_calculate_pickle_checksums(self):
+        checksums = _calculate_pickle_checksums(['member1', 'member2', 
'member3'])
+        assert 2 <= len(checksums) <= 3, checksums  # expecting ['0xc0af380' 
(MD5), '0x0c75bd4', '0xa7a7b94']
+
 
 if __name__ == "__main__":
     import unittest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Shadow.py 
new/Cython-0.29.32/Cython/Shadow.py
--- old/Cython-0.29.30/Cython/Shadow.py 2022-05-17 18:38:34.145270300 +0200
+++ new/Cython-0.29.32/Cython/Shadow.py 2022-07-29 08:30:24.223703600 +0200
@@ -1,7 +1,7 @@
 # cython.* namespace for pure mode.
 from __future__ import absolute_import
 
-__version__ = "0.29.30"
+__version__ = "0.29.32"
 
 try:
     from __builtin__ import basestring
@@ -353,7 +353,7 @@
     __getitem__ = index_type
 
 class _FusedType(CythonType):
-    pass
+    __getitem__ = index_type
 
 
 def fused_type(*args):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Utility/ImportExport.c 
new/Cython-0.29.32/Cython/Utility/ImportExport.c
--- old/Cython-0.29.30/Cython/Utility/ImportExport.c    2022-05-17 
18:38:34.149270300 +0200
+++ new/Cython-0.29.32/Cython/Utility/ImportExport.c    2022-07-29 
08:30:24.227703600 +0200
@@ -228,9 +228,9 @@
 
 // PY_VERSION_HEX >= 0x03030000
 #if PY_MAJOR_VERSION >= 3 && !CYTHON_PEP489_MULTI_PHASE_INIT
-static int __Pyx_SetPackagePathFromImportLib(const char* parent_package_name, 
PyObject *module_name);
+static int __Pyx_SetPackagePathFromImportLib(PyObject *module_name);
 #else
-#define __Pyx_SetPackagePathFromImportLib(a, b) 0
+#define __Pyx_SetPackagePathFromImportLib(a) 0
 #endif
 
 /////////////// SetPackagePathFromImportLib ///////////////
@@ -239,32 +239,21 @@
 
 // PY_VERSION_HEX >= 0x03030000
 #if PY_MAJOR_VERSION >= 3 && !CYTHON_PEP489_MULTI_PHASE_INIT
-static int __Pyx_SetPackagePathFromImportLib(const char* parent_package_name, 
PyObject *module_name) {
-    PyObject *importlib, *loader, *osmod, *ossep, *parts, *package_path;
-    PyObject *path = NULL, *file_path = NULL;
+static int __Pyx_SetPackagePathFromImportLib(PyObject *module_name) {
+    PyObject *importlib, *osmod, *ossep, *parts, *package_path;
+    PyObject *file_path = NULL;
     int result;
-    if (parent_package_name) {
-        PyObject *package = PyImport_ImportModule(parent_package_name);
-        if (unlikely(!package))
-            goto bad;
-        path = PyObject_GetAttrString(package, "__path__");
-        Py_DECREF(package);
-        if (unlikely(!path) || unlikely(path == Py_None))
-            goto bad;
-    } else {
-        path = Py_None; Py_INCREF(Py_None);
-    }
-    // package_path = [importlib.find_loader(module_name, 
path).path.rsplit(os.sep, 1)[0]]
-    importlib = PyImport_ImportModule("importlib");
+    PyObject *spec;
+    // package_path = 
[importlib.util.find_spec(module_name).origin.rsplit(os.sep, 1)[0]]
+    importlib = PyImport_ImportModule("importlib.util");
     if (unlikely(!importlib))
         goto bad;
-    loader = PyObject_CallMethod(importlib, "find_loader", "(OO)", 
module_name, path);
+    spec = PyObject_CallMethod(importlib, "find_spec", "(O)", module_name);
     Py_DECREF(importlib);
-    Py_DECREF(path); path = NULL;
-    if (unlikely(!loader))
+    if (unlikely(!spec))
         goto bad;
-    file_path = PyObject_GetAttrString(loader, "path");
-    Py_DECREF(loader);
+    file_path = PyObject_GetAttrString(spec, "origin");
+    Py_DECREF(spec);
     if (unlikely(!file_path))
         goto bad;
 
@@ -291,7 +280,6 @@
 
 bad:
     PyErr_WriteUnraisable(module_name);
-    Py_XDECREF(path);
     Py_XDECREF(file_path);
 
     // set an empty path list on failure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Utility/MemoryView.pyx 
new/Cython-0.29.32/Cython/Utility/MemoryView.pyx
--- old/Cython-0.29.30/Cython/Utility/MemoryView.pyx    2022-05-17 
18:38:34.149270300 +0200
+++ new/Cython-0.29.32/Cython/Utility/MemoryView.pyx    2022-07-29 
08:30:24.227703600 +0200
@@ -23,6 +23,7 @@
     void *memset(void *b, int c, size_t len)
 
 cdef extern from *:
+    bint __PYX_CYTHON_ATOMICS_ENABLED() noexcept
     int __Pyx_GetBuffer(object, Py_buffer *, int) except -1
     void __Pyx_ReleaseBuffer(Py_buffer *)
 
@@ -351,14 +352,15 @@
                 (<__pyx_buffer *> &self.view).obj = Py_None
                 Py_INCREF(Py_None)
 
-        global __pyx_memoryview_thread_locks_used
-        if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
-            self.lock = 
__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
-            __pyx_memoryview_thread_locks_used += 1
-        if self.lock is NULL:
-            self.lock = PyThread_allocate_lock()
+        if not __PYX_CYTHON_ATOMICS_ENABLED():
+            global __pyx_memoryview_thread_locks_used
+            if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+                self.lock = 
__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+                __pyx_memoryview_thread_locks_used += 1
             if self.lock is NULL:
-                raise MemoryError
+                self.lock = PyThread_allocate_lock()
+                if self.lock is NULL:
+                    raise MemoryError
 
         if flags & PyBUF_FORMAT:
             self.dtype_is_object = (self.view.format[0] == b'O' and 
self.view.format[1] == b'\0')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Utility/MemoryView_C.c 
new/Cython-0.29.32/Cython/Utility/MemoryView_C.c
--- old/Cython-0.29.30/Cython/Utility/MemoryView_C.c    2022-05-17 
18:38:34.149270300 +0200
+++ new/Cython-0.29.32/Cython/Utility/MemoryView_C.c    2022-07-29 
08:30:24.227703600 +0200
@@ -24,38 +24,34 @@
 #ifndef CYTHON_ATOMICS
     #define CYTHON_ATOMICS 1
 #endif
+// using CYTHON_ATOMICS as a cdef extern bint in the Cython memoryview code
+// interacts badly with "import *". Therefore, define a helper function-like 
macro
+#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
 
 #define __pyx_atomic_int_type int
-// todo: Portland pgcc, maybe OS X's OSAtomicIncrement32,
-//       libatomic + autotools-like distutils support? Such a pain...
-#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||           \
-                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
-                    !defined(__i386__)
+
+#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 && \
+                    (__GNUC_MINOR__ > 1 ||  \
+                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
     /* gcc >= 4.1.2 */
-    #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 
1)
-    #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 
1)
+    #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
+    #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
 
     #ifdef __PYX_DEBUG_ATOMICS
         #warning "Using GNU atomics"
     #endif
-#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
     /* msvc */
-    #include <Windows.h>
+    #include <intrin.h>
     #undef __pyx_atomic_int_type
-    #define __pyx_atomic_int_type LONG
-    #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
-    #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+    #define __pyx_atomic_int_type long
+    #pragma intrinsic (_InterlockedExchangeAdd)
+    #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
+    #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
 
     #ifdef __PYX_DEBUG_ATOMICS
         #pragma message ("Using MSVC atomics")
     #endif
-#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
-    #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
-    #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
-
-    #ifdef __PYX_DEBUG_ATOMICS
-        #warning "Using Intel atomics"
-    #endif
 #else
     #undef CYTHON_ATOMICS
     #define CYTHON_ATOMICS 0
@@ -69,9 +65,9 @@
 
 #if CYTHON_ATOMICS
     #define __pyx_add_acquisition_count(memview) \
-             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), 
memview->lock)
+             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
     #define __pyx_sub_acquisition_count(memview) \
-            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), 
memview->lock)
+            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
 #else
     #define __pyx_add_acquisition_count(memview) \
             
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), 
memview->lock)
@@ -450,7 +446,7 @@
     va_list vargs;
     char msg[200];
 
-#ifdef HAVE_STDARG_PROTOTYPES
+#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
     va_start(vargs, fmt);
 #else
     va_start(vargs);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Utility/ModuleSetupCode.c 
new/Cython-0.29.32/Cython/Utility/ModuleSetupCode.c
--- old/Cython-0.29.30/Cython/Utility/ModuleSetupCode.c 2022-05-17 
18:38:34.149270300 +0200
+++ new/Cython-0.29.32/Cython/Utility/ModuleSetupCode.c 2022-07-29 
08:30:24.227703600 +0200
@@ -46,6 +46,7 @@
   #define CYTHON_COMPILING_IN_PYPY 1
   #define CYTHON_COMPILING_IN_PYSTON 0
   #define CYTHON_COMPILING_IN_CPYTHON 0
+  #define CYTHON_COMPILING_IN_NOGIL 0
 
   #undef CYTHON_USE_TYPE_SLOTS
   #define CYTHON_USE_TYPE_SLOTS 0
@@ -91,6 +92,7 @@
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
   #define CYTHON_COMPILING_IN_CPYTHON 0
+  #define CYTHON_COMPILING_IN_NOGIL 0
 
   #ifndef CYTHON_USE_TYPE_SLOTS
     #define CYTHON_USE_TYPE_SLOTS 1
@@ -133,10 +135,58 @@
     #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
   #endif
 
+#elif defined(PY_NOGIL)
+  #define CYTHON_COMPILING_IN_PYPY 0
+  #define CYTHON_COMPILING_IN_PYSTON 0
+  #define CYTHON_COMPILING_IN_CPYTHON 0
+  #define CYTHON_COMPILING_IN_NOGIL 1
+
+  #ifndef CYTHON_USE_TYPE_SLOTS
+    #define CYTHON_USE_TYPE_SLOTS 1
+  #endif
+  #undef CYTHON_USE_PYTYPE_LOOKUP
+  #define CYTHON_USE_PYTYPE_LOOKUP 0
+  #ifndef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
+  #undef CYTHON_USE_PYLIST_INTERNALS
+  #define CYTHON_USE_PYLIST_INTERNALS 0
+  #ifndef CYTHON_USE_UNICODE_INTERNALS
+    #define CYTHON_USE_UNICODE_INTERNALS 1
+  #endif
+  #undef CYTHON_USE_UNICODE_WRITER
+  #define CYTHON_USE_UNICODE_WRITER 0
+  #undef CYTHON_USE_PYLONG_INTERNALS
+  #define CYTHON_USE_PYLONG_INTERNALS 0
+  #ifndef CYTHON_AVOID_BORROWED_REFS
+    #define CYTHON_AVOID_BORROWED_REFS 0
+  #endif
+  #ifndef CYTHON_ASSUME_SAFE_MACROS
+    #define CYTHON_ASSUME_SAFE_MACROS 1
+  #endif
+  #ifndef CYTHON_UNPACK_METHODS
+    #define CYTHON_UNPACK_METHODS 1
+  #endif
+  #undef CYTHON_FAST_THREAD_STATE
+  #define CYTHON_FAST_THREAD_STATE 0
+  #undef CYTHON_FAST_PYCALL
+  #define CYTHON_FAST_PYCALL 0
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE 1
+  #endif
+  #undef CYTHON_USE_DICT_VERSIONS
+  #define CYTHON_USE_DICT_VERSIONS 0
+  #undef CYTHON_USE_EXC_INFO_STACK
+  #define CYTHON_USE_EXC_INFO_STACK 0
+
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
   #define CYTHON_COMPILING_IN_CPYTHON 1
+  #define CYTHON_COMPILING_IN_NOGIL 0
 
   #ifndef CYTHON_USE_TYPE_SLOTS
     #define CYTHON_USE_TYPE_SLOTS 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/Cython/Utility/StringTools.c 
new/Cython-0.29.32/Cython/Utility/StringTools.c
--- old/Cython-0.29.30/Cython/Utility/StringTools.c     2022-05-17 
18:38:34.149270300 +0200
+++ new/Cython-0.29.32/Cython/Utility/StringTools.c     2022-07-29 
08:30:24.227703600 +0200
@@ -953,7 +953,7 @@
                 padding = PyUnicode_FromOrdinal(padding_char);
                 if (likely(padding) && uoffset > prepend_sign + 1) {
                     PyObject *tmp;
-                    PyObject *repeat = PyInt_FromSize_t(uoffset - 
prepend_sign);
+                    PyObject *repeat = PyInt_FromSsize_t(uoffset - 
prepend_sign);
                     if (unlikely(!repeat)) goto done_or_error;
                     tmp = PyNumber_Multiply(padding, repeat);
                     Py_DECREF(repeat);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/PKG-INFO new/Cython-0.29.32/PKG-INFO
--- old/Cython-0.29.30/PKG-INFO 2022-05-17 18:38:47.409286300 +0200
+++ new/Cython-0.29.32/PKG-INFO 2022-07-29 08:30:35.943727300 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: Cython
-Version: 0.29.30
+Version: 0.29.32
 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.30/docs/src/userguide/language_basics.rst 
new/Cython-0.29.32/docs/src/userguide/language_basics.rst
--- old/Cython-0.29.30/docs/src/userguide/language_basics.rst   2022-05-17 
18:38:34.169270300 +0200
+++ new/Cython-0.29.32/docs/src/userguide/language_basics.rst   2022-07-29 
08:30:24.247703800 +0200
@@ -414,6 +414,17 @@
 Otherwise, an explicit error return value allows the C compiler to generate
 more efficient code and is thus generally preferable.
 
+To explicitly mark a function as not returning an exception use
+``noexcept``.
+
+    cdef int spam() noexcept:
+        ...
+
+This is worth doing because (a) "explicit is better than implicit", and
+(b) the default behaviour for ``cdef`` functions will change in Cython 3.0
+so that functions will propagate exceptions by default. Therefore, it is
+best to mark them now if you want them to swallow exceptions in the future.
+
 An external C++ function that may raise an exception can be declared with::
 
     cdef int spam() except +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.30/docs/src/userguide/sharing_declarations.rst 
new/Cython-0.29.32/docs/src/userguide/sharing_declarations.rst
--- old/Cython-0.29.30/docs/src/userguide/sharing_declarations.rst      
2022-05-17 18:38:34.169270300 +0200
+++ new/Cython-0.29.32/docs/src/userguide/sharing_declarations.rst      
2022-07-29 08:30:24.247703800 +0200
@@ -166,13 +166,6 @@
 
 .. literalinclude:: ../../examples/userguide/sharing_declarations/spammery.pyx
 
-.. note::
-
-    When a module exports a C function in this way, an object appears in the
-    module dictionary under the function's name. However, you can't make use of
-    this object from Python, nor can you use it from Cython using a normal 
import
-    statement; you have to use :keyword:`cimport`.
-
 .. _sharing_extension_types:
 
 Sharing Extension Types
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/buffers/bufaccess.pyx 
new/Cython-0.29.32/tests/buffers/bufaccess.pyx
--- old/Cython-0.29.30/tests/buffers/bufaccess.pyx      2022-05-17 
18:38:34.173270200 +0200
+++ new/Cython-0.29.32/tests/buffers/bufaccess.pyx      2022-07-29 
08:30:24.251703700 +0200
@@ -10,7 +10,7 @@
 from __future__ import unicode_literals
 
 from cpython.object cimport PyObject
-from cpython.ref cimport Py_INCREF, Py_DECREF
+from cpython.ref cimport Py_INCREF, Py_DECREF, Py_CLEAR
 cimport cython
 
 __test__ = {}
@@ -1005,6 +1005,46 @@
     buf[idx] = obj
 
 @testcase
+def check_object_nulled_1d(MockBuffer[object, ndim=1] buf, int idx, obj):
+    """
+    See comments on printbuf_object above.
+
+    >>> a = object()
+    >>> rc1 = get_refcount(a)
+    >>> A = ObjectMockBuffer(None, [a, a])
+    >>> check_object_nulled_1d(A, 0, a)
+    >>> check_object_nulled_1d(A, 1, a)
+    >>> A = ObjectMockBuffer(None, [a, a, a, a], strides=(2,))
+    >>> check_object_nulled_1d(A, 0, a)  # only 0 due to stride
+    >>> get_refcount(a) == rc1
+    True
+    """
+    cdef PyObject **data = <PyObject **>buf.buffer
+    Py_CLEAR(data[idx])
+    res = buf[idx]  # takes None
+    buf[idx] = obj
+    return res
+
+@testcase
+def check_object_nulled_2d(MockBuffer[object, ndim=2] buf, int idx1, int idx2, 
obj):
+    """
+    See comments on printbuf_object above.
+
+    >>> a = object()
+    >>> rc1 = get_refcount(a)
+    >>> A = ObjectMockBuffer(None, [a, a, a, a], shape=(2, 2))
+    >>> check_object_nulled_2d(A, 0, 0, a)
+    >>> check_object_nulled_2d(A, 1, 1, a)
+    >>> get_refcount(a) == rc1
+    True
+    """
+    cdef PyObject **data = <PyObject **>buf.buffer
+    Py_CLEAR(data[idx1 + 2*idx2])
+    res = buf[idx1, idx2]  # takes None
+    buf[idx1, idx2] = obj
+    return res
+
+@testcase
 def assign_temporary_to_object(object[object] buf):
     """
     See comments on printbuf_object above.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/compile/buildenv.pyx 
new/Cython-0.29.32/tests/compile/buildenv.pyx
--- old/Cython-0.29.30/tests/compile/buildenv.pyx       2022-05-17 
18:38:34.177270400 +0200
+++ new/Cython-0.29.32/tests/compile/buildenv.pyx       2022-07-29 
08:30:24.255704000 +0200
@@ -36,6 +36,7 @@
     cdef int CYTHON_COMPILING_IN_CPYTHON
     cdef int CYTHON_COMPILING_IN_PYPY
     cdef int CYTHON_COMPILING_IN_PYSTON
+    cdef int CYTHON_COMPILING_IN_NOGIL
     cdef int CYTHON_USE_PYLONG_INTERNALS
     cdef int CYTHON_USE_PYLIST_INTERNALS
     cdef int CYTHON_USE_UNICODE_INTERNALS
@@ -78,6 +79,7 @@
 CYTHON_COMPILING_IN_CPYTHON  {CYTHON_COMPILING_IN_CPYTHON}
 CYTHON_COMPILING_IN_PYPY  {CYTHON_COMPILING_IN_PYPY}
 CYTHON_COMPILING_IN_PYSTON  {CYTHON_COMPILING_IN_PYSTON}
+CYTHON_COMPILING_IN_NOGIL  {CYTHON_COMPILING_IN_NOGIL}
 
 CYTHON_USE_PYLONG_INTERNALS  {CYTHON_USE_PYLONG_INTERNALS}
 CYTHON_USE_PYLIST_INTERNALS  {CYTHON_USE_PYLIST_INTERNALS}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/compile/excvaldecl.pyx 
new/Cython-0.29.32/tests/compile/excvaldecl.pyx
--- old/Cython-0.29.30/tests/compile/excvaldecl.pyx     2022-05-17 
18:38:34.177270400 +0200
+++ new/Cython-0.29.32/tests/compile/excvaldecl.pyx     2022-07-29 
08:30:24.255704000 +0200
@@ -18,9 +18,17 @@
 cdef int silly() except -1:
     pass
 
+cdef int not_so_silly() noexcept:
+    pass
+
+cdef int not_so_silly_and_gilless() noexcept nogil:
+    pass
+
 spam()
 eggs()
 grail()
 tomato()
 brian()
 silly()
+not_so_silly()
+not_so_silly_and_gilless()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.30/tests/compile/fused_redeclare_T3111.pyx 
new/Cython-0.29.32/tests/compile/fused_redeclare_T3111.pyx
--- old/Cython-0.29.30/tests/compile/fused_redeclare_T3111.pyx  2022-05-17 
18:38:34.181270400 +0200
+++ new/Cython-0.29.32/tests/compile/fused_redeclare_T3111.pyx  2022-07-29 
08:30:24.259703900 +0200
@@ -24,8 +24,8 @@
 _WARNINGS = """
 20:10: 'cpdef_method' redeclared
 31:10: 'cpdef_cname_method' redeclared
-446:72: Argument evaluation order in C function call is undefined and may not 
be as expected
-446:72: Argument evaluation order in C function call is undefined and may not 
be as expected
-749:34: Argument evaluation order in C function call is undefined and may not 
be as expected
-749:34: Argument evaluation order in C function call is undefined and may not 
be as expected
+448:72: Argument evaluation order in C function call is undefined and may not 
be as expected
+448:72: Argument evaluation order in C function call is undefined and may not 
be as expected
+751:34: Argument evaluation order in C function call is undefined and may not 
be as expected
+751:34: Argument evaluation order in C function call is undefined and may not 
be as expected
 """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/compile/module_name_arg.srctree 
new/Cython-0.29.32/tests/compile/module_name_arg.srctree
--- old/Cython-0.29.30/tests/compile/module_name_arg.srctree    1970-01-01 
01:00:00.000000000 +0100
+++ new/Cython-0.29.32/tests/compile/module_name_arg.srctree    2022-07-29 
08:30:24.259703900 +0200
@@ -0,0 +1,52 @@
+# Test that we can set module name with --module-name arg to cython
+CYTHON a.pyx
+CYTHON --module-name w b.pyx
+CYTHON --module-name my_module.submod.x c.pyx
+PYTHON setup.py build_ext --inplace
+PYTHON checks.py
+
+######## checks.py ########
+
+from importlib import import_module
+
+try:
+    exc = ModuleNotFoundError
+except NameError:
+    exc = ImportError
+
+for module_name, should_import in (
+    ('a', True),
+    ('b', False),
+    ('w', True),
+    ('my_module.submod.x', True),
+    ('c', False),
+    ):
+    try:
+        import_module(module_name)
+    except exc:
+        if should_import:
+            assert False, "Cannot import module " + module_name
+    else:
+        if not should_import:
+            assert False, ("Can import module " + module_name +
+                           " but import should not be possible")
+
+
+######## setup.py ########
+
+from distutils.core import setup
+from distutils.extension import Extension
+
+setup(
+  ext_modules = [
+    Extension("a", ["a.c"]),
+    Extension("w", ["b.c"]),
+    Extension("my_module.submod.x", ["c.c"]),
+  ],
+)
+
+######## a.pyx ########
+######## b.pyx ########
+######## c.pyx ########
+######## my_module/__init__.py ########
+######## my_module/submod/__init__.py ########
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/memoryview/memslice.pyx 
new/Cython-0.29.32/tests/memoryview/memslice.pyx
--- old/Cython-0.29.30/tests/memoryview/memslice.pyx    2022-05-17 
18:38:34.189270300 +0200
+++ new/Cython-0.29.32/tests/memoryview/memslice.pyx    2022-07-29 
08:30:24.267704000 +0200
@@ -5,7 +5,7 @@
 from __future__ import unicode_literals
 
 from cpython.object cimport PyObject
-from cpython.ref cimport Py_INCREF, Py_DECREF
+from cpython.ref cimport Py_INCREF, Py_DECREF, Py_CLEAR
 
 cimport cython
 from cython cimport view
@@ -21,6 +21,12 @@
 else:
     import builtins
 
+try:
+    from Cython.Tests.this_module_does_not_exist import *
+except ImportError:
+    # Fails, but the existence of "import *" interacted badly with some 
utility code
+    pass
+
 
 def testcase(func):
     @wraps(func)
@@ -1130,6 +1136,49 @@
     """
     buf[1] = {3-2: 2+(2*4)-2}
 
+@testcase
+def check_object_nulled_1d(object[:] buf, int idx, obj):
+    """
+    See comments on printbuf_object above.
+
+    >>> a = object()
+    >>> rc1 = get_refcount(a)
+    >>> A = ObjectMockBuffer(None, [a, a])
+    >>> check_object_nulled_1d(A, 0, a)
+    >>> check_object_nulled_1d(A, 1, a)
+    >>> A = ObjectMockBuffer(None, [a, a, a, a], strides=(2,))
+    >>> check_object_nulled_1d(A, 0, a)  # only 0 due to stride
+    >>> get_refcount(a) == rc1
+    True
+    """
+    cdef ObjectMockBuffer omb = buf.base
+    cdef PyObject **data = <PyObject**>(omb.buffer)
+    Py_CLEAR(data[idx])
+    res = buf[idx]  # takes None
+    buf[idx] = obj
+    return res
+
+@testcase
+def check_object_nulled_2d(object[:, ::1] buf, int idx1, int idx2, obj):
+    """
+    See comments on printbuf_object above.
+
+    >>> a = object()
+    >>> rc1 = get_refcount(a)
+    >>> A = ObjectMockBuffer(None, [a, a, a, a], shape=(2, 2))
+    >>> check_object_nulled_2d(A, 0, 0, a)
+    >>> check_object_nulled_2d(A, 1, 1, a)
+    >>> get_refcount(a) == rc1
+    True
+    """
+    cdef ObjectMockBuffer omb = buf.base
+    cdef PyObject **data = <PyObject**>(omb.buffer)
+    Py_CLEAR(data[idx1 + 2*idx2])
+    res = buf[idx1, idx2]  # takes None
+    buf[idx1, idx2] = obj
+    return res
+
+
 #
 # Test __cythonbufferdefaults__
 #
@@ -2506,3 +2555,42 @@
     cdef const int[:] c = a
     print(a[0])
     print(c[-1])
+
+
+@testcase
+def test_arg_in_closure(int [:] a):
+    """
+    >>> A = IntMockBuffer("A", range(6), shape=(6,))
+    >>> inner = test_arg_in_closure(A)
+    acquired A
+    >>> inner()
+    (0, 1)
+
+    The assignment below is just to avoid printing what was collected
+    >>> del inner; ignore_me = gc.collect()
+    released A
+    """
+    def inner():
+        return (a[0], a[1])
+    return inner
+
+
+cdef arg_in_closure_cdef(int [:] a):
+    def inner():
+        return (a[0], a[1])
+    return inner
+
+def test_arg_in_closure_cdef(a):
+    """
+    >>> A = IntMockBuffer("A", range(6), shape=(6,))
+    >>> inner = test_arg_in_closure_cdef(A)
+    acquired A
+    >>> inner()
+    (0, 1)
+
+    The assignment below is just to avoid printing what was collected
+    >>> del inner; ignore_me = gc.collect()
+    released A
+    """
+    return arg_in_closure_cdef(a)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/run/append.pyx 
new/Cython-0.29.32/tests/run/append.pyx
--- old/Cython-0.29.30/tests/run/append.pyx     2022-05-17 18:38:34.193270400 
+0200
+++ new/Cython-0.29.32/tests/run/append.pyx     2022-07-29 08:30:24.271704000 
+0200
@@ -1,3 +1,5 @@
+cimport cython
+
 class A:
     def append(self, x):
         print u"appending", x
@@ -94,3 +96,35 @@
     'append'
     """
     return [].append.__name__
+
+@cython.test_assert_path_exists(
+    '//PythonCapiCallNode')
+def append_optimized(probably_list):
+    """
+    >>> l = []
+    >>> append_optimized(l)
+    >>> l
+    [1]
+    """
+    probably_list.append(1)
+
+cdef class AppendBug:
+    # https://github.com/cython/cython/issues/4828
+    # if the attribute "append" is found it shouldn't be replaced with
+    # __Pyx_PyObject_Append
+    cdef object append
+    def __init__(self, append):
+        self.append = append
+
+@cython.test_fail_if_path_exists(
+    '//PythonCapiCallNode')
+def specific_attribute(AppendBug a):
+    """
+    >>> def append_to_default_arg(a, arg=[]):
+    ...    arg.append(a)
+    ...    return arg
+    >>> specific_attribute(AppendBug(append_to_default_arg))
+    >>> append_to_default_arg(None)
+    [1, None]
+    """
+    a.append(1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.30/tests/run/bytearray_iter.py 
new/Cython-0.29.32/tests/run/bytearray_iter.py
--- old/Cython-0.29.30/tests/run/bytearray_iter.py      1970-01-01 
01:00:00.000000000 +0100
+++ new/Cython-0.29.32/tests/run/bytearray_iter.py      2022-07-29 
08:30:24.271704000 +0200
@@ -0,0 +1,15 @@
+# mode: run
+# ticket: 3473
+
+def test_bytearray_iteration(src):
+    """
+    >>> src = b'123'
+    >>> test_bytearray_iteration(src)
+    49
+    50
+    51
+    """
+
+    data = bytearray(src)
+    for elem in data:
+        print(elem)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.30/tests/run/pep448_extended_unpacking.pyx 
new/Cython-0.29.32/tests/run/pep448_extended_unpacking.pyx
--- old/Cython-0.29.30/tests/run/pep448_extended_unpacking.pyx  2022-05-17 
18:38:34.213270400 +0200
+++ new/Cython-0.29.32/tests/run/pep448_extended_unpacking.pyx  2022-07-29 
08:30:24.295704100 +0200
@@ -185,6 +185,24 @@
     return [*([1, 2, *([4, 5] * 2)] * 3)]
 
 
+def unpack_list_tuple_mult():
+    """
+    >>> unpack_list_tuple_mult()
+    [1, 1]
+    """
+    return [*(1,) * 2]
+
+
+def unpack_list_tuple_bad_mult():
+    """
+    >>> unpack_list_tuple_bad_mult()  # doctest: +ELLIPSIS
+    Traceback (most recent call last):
+    ...
+    TypeError: ... 'float'
+    """
+    return [*(1,) * 1.5]
+
+
 @cython.test_fail_if_path_exists(
     "//ListNode//ListNode",
     "//MergedSequenceNode",

Reply via email to