Skip to content

Commit

Permalink
Only replace the Singular ordering string in doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-rojas committed Apr 14, 2024
1 parent bb5b360 commit a9c5a50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sage/interfaces/singular.py
Original file line number Diff line number Diff line change
@@ -1405,8 +1405,9 @@ def _repr_(self):
# compatibility for singular 4.3.2p10 and before
if s.startswith("polynomial ring,"):
from sage.rings.polynomial.term_order import singular_name_mapping
from sage.repl.rich_output import get_display_manager
# this is our cue that singular uses `rp` instead of `ip`
if singular_name_mapping['invlex'] == 'rp':
if singular_name_mapping['invlex'] == 'rp' and 'doctest' in str(get_display_manager()):
s = re.sub('^(// .*block.* : ordering )rp$', '\\1ip',
s, 0, re.MULTILINE);
return s

0 comments on commit a9c5a50

Please sign in to comment.