Skip to content

Commit 9ab4078

Browse files
committed
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
1 parent dfd9a71 commit 9ab4078

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rdflib/plugins/sparql/aggregates.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ def use_row(self, row):
7272

7373

7474
def type_safe_numbers(*args):
75-
types = map(type, args)
76-
if float in types and Decimal in types:
75+
if (
76+
any(isinstance(arg, float) for arg in args)
77+
and any(isinstance(arg, Decimal) for arg in args)
78+
):
7779
return map(float, args)
7880
return args
7981

0 commit comments

Comments
 (0)