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

Commit

Permalink
Wrap sendline() in try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Jun 18, 2015
1 parent 08e422a commit 15e42fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sage/interfaces/sagespawn.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class SageSpawn(spawn):
cdef int fd = self.child_fd
if fd != -1:
if self.quit_string is not None:
self.sendline(self.quit_string)
try:
# This can fail if the process already exited
self.sendline(self.quit_string)
except OSError:
pass
close(fd)
self.child_fd = -1
self.closed = 1
Expand Down

0 comments on commit 15e42fe

Please sign in to comment.