Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 15e42fe

Browse files
committedJun 18, 2015
Wrap sendline() in try/except
1 parent 08e422a commit 15e42fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/sage/interfaces/sagespawn.pyx

+5-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ class SageSpawn(spawn):
128128
cdef int fd = self.child_fd
129129
if fd != -1:
130130
if self.quit_string is not None:
131-
self.sendline(self.quit_string)
131+
try:
132+
# This can fail if the process already exited
133+
self.sendline(self.quit_string)
134+
except OSError:
135+
pass
132136
close(fd)
133137
self.child_fd = -1
134138
self.closed = 1

0 commit comments

Comments
 (0)
This repository has been archived.