diff options
| author | Joern Hees <dev@joernhees.de> | 2017-01-28 20:55:00 +0100 |
|---|---|---|
| committer | Gunnar Aastrand Grimnes <gromgull@gmail.com> | 2017-01-30 17:43:04 +0100 |
| commit | bfc4f19133f0b123b47fe8b62138ee7bb7834065 (patch) | |
| tree | 8c7a6323b0fd6366f3d0de3d76dfe128c92337d8 | |
| parent | b16108db5ac24ac528b5ed5c8af3900ef598a46f (diff) | |
| download | rdflib-bfc4f19133f0b123b47fe8b62138ee7bb7834065.tar.gz | |
six: sparql aggregates no longer relies on map returning a list
the types variable became an iterable and was exhausted on 2nd check in py3
| -rw-r--r-- | rdflib/plugins/sparql/aggregates.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rdflib/plugins/sparql/aggregates.py b/rdflib/plugins/sparql/aggregates.py index c488323a..df4083e4 100644 --- a/rdflib/plugins/sparql/aggregates.py +++ b/rdflib/plugins/sparql/aggregates.py @@ -72,8 +72,10 @@ class Counter(Accumulator): def type_safe_numbers(*args): - types = map(type, args) - if float in types and Decimal in types: + if ( + any(isinstance(arg, float) for arg in args) + and any(isinstance(arg, Decimal) for arg in args) + ): return map(float, args) return args |
