Skip to content

Commit

Permalink
Workaround warning in cython 3.0.9 (sagemath#37560)
Browse files Browse the repository at this point in the history
A new warning breaks doctests. We filter it out.
  • Loading branch information
tornaria committed Mar 9, 2024
1 parent cb8e15b commit cd652c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sage/misc/cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit cd652c6

Please sign in to comment.