Skip to content

Commit 5d5eb8a

Browse files
committed
Better type assertion
1 parent 8dec167 commit 5d5eb8a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

splunklib/searchcommands/search_command.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,7 @@ def _as_binary_stream(ifile):
862862
@staticmethod
863863
def _read_chunk(istream):
864864
# noinspection PyBroadException
865-
if not six.PY2:
866-
assert issubclass(type(istream), (io.BufferedIOBase, io.RawIOBase)), 'Stream must be binary'
865+
assert isinstance(istream.read(0), six.binary_type), 'Stream must be binary'
867866

868867
try:
869868
header = istream.readline()

0 commit comments

Comments
 (0)