Skip to content

Commit

Permalink
Merge pull request #44 from ftaebi/fix_byte_str_comp
Browse files Browse the repository at this point in the history
fix lines resulting in string-bytes comparison error
  • Loading branch information
willtrnr authored Oct 11, 2022
2 parents 3b0e3e3 + a680f19 commit aa866dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyxlsb/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def read_short(self):

def read_byte(self):
byte = self._fp.read(1)
if byte == b'':
if not byte:
return None
return uint8_t.unpack(byte)[0]

Expand Down Expand Up @@ -144,7 +144,7 @@ def read_id(self):
v = 0
for i in range(4):
byte = self._fp.read(1)
if byte == '':
if not byte:
return None
byte = uint8_t.unpack(byte)[0]
v += byte << 8 * i
Expand All @@ -156,7 +156,7 @@ def read_len(self):
v = 0
for i in range(4):
byte = self._fp.read(1)
if byte == '':
if not byte:
return None
byte = uint8_t.unpack(byte)[0]
v += (byte & 0x7F) << (7 * i)
Expand Down

0 comments on commit aa866dc

Please sign in to comment.