pipe error checking

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-05-30 15:01:22 +00:00
parent 132d488c5d
commit 5f99e1f8fb
1 changed files with 5 additions and 0 deletions

View File

@ -399,6 +399,9 @@ class ConsoleBuffer(Buffer):
def readonly(self):
return True
class InterpreterPipeError(Exception):
pass
class InterpreterBuffer(Buffer):
_basename = 'Interpreter'
def create_name(cls, parent):
@ -432,6 +435,8 @@ class InterpreterBuffer(Buffer):
def get_cmd(self):
raise Exception, 'unimplemented'
def pipe_readline(self):
if self.pipe.poll() is not None:
raise InterpreterPipeError('broken pipe')
line = self.pipe.stdout.readline()
m = self.readre.match(line)
if m: