Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
fix: Change a check for char == b'' to 'not char'.
Browse files Browse the repository at this point in the history
This should be safer if stream_read returns None or empty string instead of empty bytes.
  • Loading branch information
beneboy committed Dec 12, 2019
1 parent facc564 commit cdb7683
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stencila/pyla/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def read_one(stream: StreamType) -> int:
Raises EOFError if the stream ends while reading bytes.
"""
char = stream_read(stream, 1)
if char == b'':
if not char:
raise EOFError('Unexpected EOF while reading bytes')
return ord(char)

Expand Down

0 comments on commit cdb7683

Please sign in to comment.