From 2852fb6791c2d1ec8ef2f8f4a2a2099193ccf7fb 2011-05-11 23:13:32 From: MinRK Date: 2011-05-11 23:13:32 Subject: [PATCH] in irunner, don't send last newline if child is gone fixes an issue where irunner could send last newline after child exits, raising an OSError --- diff --git a/IPython/lib/irunner.py b/IPython/lib/irunner.py index 5c97cfa..c132f58 100755 --- a/IPython/lib/irunner.py +++ b/IPython/lib/irunner.py @@ -263,7 +263,8 @@ class InteractiveRunner(object): # Leave the child ready for more input later on, otherwise select just # hangs on the second invocation. - c.send('\n') + if c.isalive(): + c.send('\n') # Return any requested output if get_output: