Skip to content

Commit

Permalink
fix map and filter check on python 2 and 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
truebit committed Oct 21, 2019
1 parent df0c7e9 commit 9b5735e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions objectpath/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from types import GeneratorType as generator
from itertools import chain
from sys import version_info

SELECTOR_OPS = [
"is", ">", "<", "is not", ">=", "<=", "in", "not in", ":", "and", "or", "matches", "fn"
Expand All @@ -27,10 +28,8 @@

ITER_TYPES = [list, generator, chain]

try:
if version_info.major == 3:
ITER_TYPES += [map, filter]
except NameError:
pass

class ProgrammingError(Exception):
pass
Expand Down

0 comments on commit 9b5735e

Please sign in to comment.