Skip to content

Commit

Permalink
fix warnings, some types are in collections.abc
Browse files Browse the repository at this point in the history
  • Loading branch information
kneufeld committed Feb 25, 2019
1 parent cf59c0b commit de13a0e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions alkali/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ def _filter(self, field, oper, value, instances):

def in_(coll, val):
if not isinstance(coll, str) \
and isinstance(coll, collections.Iterable):
and isinstance(coll, collections.abc.Iterable):
return bool( set(coll) & set(val) ) # intersection
else:
return coll in val

def rin_(coll, val):
if not isinstance(val, str) \
and isinstance(val, collections.Iterable):
and isinstance(val, collections.abc.Iterable):
return bool( set(coll) & set(val) ) # intersection
else:
return val in coll
Expand All @@ -229,10 +229,10 @@ def regexi(coll, val):
return re.search(val, coll, re.UNICODE | re.IGNORECASE)

if oper == 'in':
assert isinstance(value, collections.Iterable)
assert isinstance(value, collections.abc.Iterable)
oper = in_
elif oper == 'rin':
assert isinstance(field, collections.Iterable)
assert isinstance(field, collections.abc.Iterable)
oper = rin_
elif oper == 're':
oper = regex
Expand Down

0 comments on commit de13a0e

Please sign in to comment.