Skip to content

Commit eedbf9d

Browse files
committed
Continue #626
Bugfix on type checking numbers
1 parent 8abfe0a commit eedbf9d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

folium/map.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"""
1010

1111
from __future__ import unicode_literals
12-
import numbers
1312
import json
1413
from collections import OrderedDict
1514

@@ -312,9 +311,10 @@ def location(self, value):
312311
raise ValueError("Location should have two values, [lat, lon]")
313312

314313
for val in value:
315-
if not isinstance(val, numbers.Rational):
316-
raise TypeError("Location values should be numeric, {val} is not a number".format(val))
317-
314+
try:
315+
float(val)
316+
except:
317+
raise TypeError("Location values should be numeric, {} is not a number".format(val))
318318

319319
self._location = value
320320

0 commit comments

Comments
 (0)