Skip to content

Commit

Permalink
Better type assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
amysutedja committed Sep 4, 2020
1 parent 8dec167 commit 5d5eb8a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions splunklib/searchcommands/search_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,7 @@ def _as_binary_stream(ifile):
@staticmethod
def _read_chunk(istream):
# noinspection PyBroadException
if not six.PY2:
assert issubclass(type(istream), (io.BufferedIOBase, io.RawIOBase)), 'Stream must be binary'
assert isinstance(istream.read(0), six.binary_type), 'Stream must be binary'

try:
header = istream.readline()
Expand Down

0 comments on commit 5d5eb8a

Please sign in to comment.