Skip to content

Commit d999b20

Browse files
committed
Only replace the Singular ordering string in doctests
1 parent e04869f commit d999b20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sage/interfaces/singular.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,9 @@ def _repr_(self):
14051405
# compatibility for singular 4.3.2p10 and before
14061406
if s.startswith("polynomial ring,"):
14071407
from sage.rings.polynomial.term_order import singular_name_mapping
1408+
from sage.repl.rich_output import get_display_manager
14081409
# this is our cue that singular uses `rp` instead of `ip`
1409-
if singular_name_mapping['invlex'] == 'rp':
1410+
if singular_name_mapping['invlex'] == 'rp' and 'doctest' in str(get_display_manager()):
14101411
s = re.sub('^(// .*block.* : ordering )rp$', '\\1ip',
14111412
s, 0, re.MULTILINE);
14121413
return s

0 commit comments

Comments
 (0)