1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-21 00:19:42 +02:00

use jc.utils type checks

This commit is contained in:
Kelly Brazil
2021-11-30 11:49:40 -08:00
parent 12d2de2282
commit e8e4b46021
5 changed files with 14 additions and 19 deletions

View File

@ -95,9 +95,8 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
Iterator object
"""
if not quiet: jc.utils.compatibility(__name__, info.compatible)
if not hasattr(data, '__iter__') or isinstance(data, (str, bytes)):
raise TypeError("Input data must be a non-string iterable object.")
jc.utils.compatibility(__name__, info.compatible, quiet)
jc.utils.streaming_input_type_check(data)
# convert data to an iterable in case a sequence like a list is used as input.
# this allows the exhaustion of the input so we don't double-process later.