From cd652c675fe358390d764dc2fcf8603e120e6b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sat, 9 Mar 2024 11:28:34 -0300 Subject: [PATCH] Workaround warning in cython 3.0.9 (#37560) A new warning breaks doctests. We filter it out. --- src/sage/misc/cython.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index 081d0562d05..c36374dbfe9 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -236,7 +236,7 @@ def cython(filename, verbose=0, compile_message=False, ... RuntimeError: Error compiling Cython file: ... - ...: 'sage/misc.pxd' not found + ...: 'sage/misc.pxd' not found... """ if not filename.endswith('pyx'): print("Warning: file (={}) should have extension .pyx".format(filename), file=sys.stderr) @@ -382,6 +382,12 @@ def cython(filename, verbose=0, compile_message=False, "Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.\n", "", cython_messages, 0, re.MULTILINE) + # workaround for https://github.com/sagemath/sage/issues/37560 + # triggered by Cython 3.0.9 + cython_messages = re.sub( + "^warning: .*noexcept clause is ignored for function returning Python object\n", + "", cython_messages, 0, re.MULTILINE) + sys.stderr.write(cython_messages) sys.stderr.flush()