Skip to content

Commit 47c6296

Browse files
author
Martin Journois
committed
Improve type tests in GeoJson
1 parent ba01ffa commit 47c6296

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

folium/features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ def __init__(self, data, style_function=None):
228228
"""
229229
super(GeoJson, self).__init__()
230230
self._name = 'GeoJson'
231-
if 'read' in dir(data):
231+
if hasattr(data,'read'):
232232
self.embed = True
233233
self.data = json.load(data)
234-
elif type(data) is dict:
234+
elif isinstance(data,dict):
235235
self.embed = True
236236
self.data = data
237237
elif isinstance(data, text_type) or isinstance(data, binary_type):

0 commit comments

Comments
 (0)