Skip to content

Commit 01782d6

Browse files
committed
Fix error in exception handling code of gap interface
1 parent 871ba9d commit 01782d6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/sage/interfaces/gap.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,15 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if
670670
Restarting Gap and trying again
671671
sage: a
672672
3
673+
674+
Checks for :issue:`39906`::
675+
676+
sage: gap("a"*200)
677+
Traceback (most recent call last):
678+
...
679+
TypeError: Gap terminated unexpectedly while reading in a large line:
680+
Gap produced error output
681+
Error, Variable: 'aaaa...aaaa' must have a value executing Read("...");
673682
"""
674683
expect_eof = self._quit_string() in line
675684

@@ -728,7 +737,7 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if
728737
else:
729738
return ''
730739
else:
731-
raise RuntimeError(exc)
740+
raise exc
732741

733742
except KeyboardInterrupt:
734743
self._keyboard_interrupt()

0 commit comments

Comments
 (0)