Skip to content

Commit c16d9fc

Browse files
committed
fix the other test
1 parent 4671675 commit c16d9fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@ def __init__(self, filename=None, stream=None, filetype=None, rect=None, width=0
29292929
w = r.x1 - r.x0
29302930
h = r.y1 - r.y0
29312931

2932-
if stream: # stream given, **MUST** be bytes!
2932+
if stream is not None:
29332933
assert isinstance(stream, (bytes, memoryview))
29342934
if len(stream) == 0:
29352935
raise EmptyFileError('Cannot open empty stream.')
@@ -2957,7 +2957,7 @@ def __init__(self, filename=None, stream=None, filetype=None, rect=None, width=0
29572957
doc = mupdf.fz_open_document_with_stream(magic, data)
29582958
except Exception as e:
29592959
if g_exceptions_verbose > 1: exception_info()
2960-
raise FileDataError(f'Failed to open stream') from e
2960+
raise FileDataError('Failed to open stream') from e
29612961
else:
29622962
if filename:
29632963
if not filetype:

0 commit comments

Comments
 (0)