Skip to content

Commit

Permalink
Fix Singular pexpect timeouts on some platforms
Browse files Browse the repository at this point in the history
This patch calls tcsetattr later in an attempt to work around a bug on
OSX Maverics and ancient Linux kernels.
  • Loading branch information
vbraun committed Jun 19, 2014
1 parent 920c16e commit 2928b9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/sage/interfaces/expect.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ def _start(self, alt_message=None, block_during_init=True):

os.chdir(current_path)
self._expect.timeout = self.__max_startup_time
if not self._terminal_echo:
self._expect.setecho(0)

#self._expect.setmaxread(self.__maxread)
self._expect.maxread = self.__maxread
Expand All @@ -451,6 +449,14 @@ def _start(self, alt_message=None, block_during_init=True):
failed_to_start.append(self.name())
raise RuntimeError("Unable to start %s"%self.name())
self._expect.timeout = None

# Calling tcsetattr earlier exposes bugs in various pty
# implementations, see :trac:`16474`. Since we haven't
# **written** anything so far it is safe to wait with
# switching echo off until now.
if not self._terminal_echo:
self._expect.setecho(0)

with gc_disabled():
if block_during_init:
for X in self.__init_code:
Expand Down

0 comments on commit 2928b9a

Please sign in to comment.