lib/polyphony/extensions/io.rb in polyphony-0.63 vs lib/polyphony/extensions/io.rb in polyphony-0.64

- old
+ new

@@ -121,12 +121,12 @@ @read_buffer = +'' already_read end alias_method :orig_readpartial, :read - def readpartial(len, str = +'', buffer_pos = 0) + def readpartial(len, str = +'', buffer_pos = 0, raise_on_eof = true) result = Polyphony.backend_read(self, str, len, false, buffer_pos) - raise EOFError unless result + raise EOFError if !result && raise_on_eof result end alias_method :orig_write, :write