lib/expectr/child.rb in expectr-2.0.1 vs lib/expectr/child.rb in expectr-2.0.2
- old
+ new
@@ -51,11 +51,11 @@
# Returns nothing.
# Raises Expectr::ProcessError if the process is not running (@pid = 0).
def send(str)
begin
@stdin.syswrite str
- rescue Errno::EIO #Application is not running
+ rescue Errno::EIO, EOFError # Application is not running
@pid = 0
end
unless @pid > 0
raise(Expectr::ProcessError, Errstr::PROCESS_GONE)
end
@@ -70,11 +70,12 @@
unless select([@stdout], nil, nil, @timeout).nil?
buf = ''
begin
@stdout.sysread(@buffer_size, buf)
- rescue Errno::EIO #Application is not running
+ rescue Errno::EIO, EOFError #Application is not running
@pid = 0
+ @thread.wakeup if @thread
return
end
process_output(buf)
end
end