void-packages/srcpkgs/sagemath/patches/39145-python_3.13_re.sub.patch
2024-12-31 13:05:08 +01:00

40 lines
1.9 KiB
Diff

diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
index d02ae43149f..447b548c1b8 100644
--- a/src/sage/interfaces/singular.py
+++ b/src/sage/interfaces/singular.py
@@ -1401,7 +1401,7 @@ def _repr_(self):
# this is our cue that singular uses `rp` instead of `ip`
if singular_name_mapping['invlex'] == 'rp' and 'doctest' in str(get_display_manager()):
s = re.sub('^(// .*block.* : ordering )rp$', '\\1ip',
- s, 0, re.MULTILINE)
+ s, flags=re.MULTILINE)
return s
def __copy__(self):
diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py
index c542e0d1919..241078d5f2c 100644
--- a/src/sage/misc/cython.py
+++ b/src/sage/misc/cython.py
@@ -380,7 +380,7 @@ def cython(filename, verbose=0, compile_message=False,
cython_messages = re.sub(
"^.*The keyword 'nogil' should appear at the end of the function signature line. "
"Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.\n",
- "", cython_messages, 0, re.MULTILINE)
+ "", cython_messages, flags=re.MULTILINE)
sys.stderr.write(cython_messages)
sys.stderr.flush()
diff --git a/src/sage/rings/ring_extension_morphism.pyx b/src/sage/rings/ring_extension_morphism.pyx
index d4aad7f8253..7294e90c319 100644
--- a/src/sage/rings/ring_extension_morphism.pyx
+++ b/src/sage/rings/ring_extension_morphism.pyx
@@ -461,7 +461,7 @@ cdef class RingExtensionHomomorphism(RingMap):
if self.base_map() is not None:
s += "with map on base ring"
ss = self.base_map()._repr_defn()
- ss = re.sub('\nwith map on base ring:?$', '', ss, 0, re.MULTILINE)
+ ss = re.sub('\nwith map on base ring:?$', '', ss, flags=re.MULTILINE)
if ss != "": s += ":\n" + ss
if s != "" and s[-1] == "\n":
s = s[:-1]