From 5f99e1f8fbde6f8ba633fb3855b7a93d61b274cc Mon Sep 17 00:00:00 2001 From: moculus Date: Fri, 30 May 2008 15:01:22 +0000 Subject: [PATCH] pipe error checking --HG-- branch : pmacs2 --- buffer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buffer.py b/buffer.py index f596956..c08c71b 100644 --- a/buffer.py +++ b/buffer.py @@ -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: