Skip to content

Commit

Permalink
do not use assert since otherwise running with -O will fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mortbauer committed Jan 5, 2025
1 parent 9485db9 commit 55f64b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rubymarshal/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,10 @@ def read_symreal(self):


def load(fd, registry=None):
assert fd.read(1) == b"\x04"
assert fd.read(1) == b"\x08"
if fd.read(1) != b"\x04":
raise ValueError(r'Expected token \x04')
if fd.read(1) != b"\x08":
raise ValueError(r'Expected token \x08')

loader = Reader(fd, registry=registry)
return loader.read()
Expand Down

0 comments on commit 55f64b0

Please sign in to comment.