Skip to content

Commit

Permalink
Merge pull request #740 from carlhoerberg/readline-eof
Browse files Browse the repository at this point in the history
Raise EOFError in Socket#readline instead of TypeError
  • Loading branch information
geemus committed Mar 21, 2021
2 parents 6a5e621 + 9ceaa9f commit 32c5322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/excon/socket.rb
Expand Up @@ -60,7 +60,7 @@ def read(max_length = nil)
def readline
return legacy_readline if RUBY_VERSION.to_f <= 1.8_7
buffer = String.new
buffer << read_nonblock(1) while buffer[-1] != "\n"
buffer << (read_nonblock(1) || raise(EOFError)) while buffer[-1] != "\n"
buffer
end

Expand Down

0 comments on commit 32c5322

Please sign in to comment.