Skip to content

Commit

Permalink
tests/test_lorem_ipsum.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed Jun 6, 2024
1 parent 969b1f6 commit 75d1d1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def get_resource_filename(filename, *, ext=None):

def open_resource(filename, *, mode="r", encoding="utf-8", **kwargs):
filename = get_resource_filename(filename, **kwargs)
return open(filename, mode=mode, encoding=encoding)
return open(
filename, mode=mode,
encoding=None if mode.endswith("b") else encoding)


def load_resource(filename, **kwargs):
Expand Down

0 comments on commit 75d1d1a

Please sign in to comment.