Skip to content

Commit 263defd

Browse files
committed
Merge pull request #321 from BibMartin/fix_colormap
Fix colormap import error in python2
2 parents 247f55b + bf7ca72 commit 263defd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

folium/colormap.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Utility module for dealing with colormaps.
77
88
"""
9+
from __future__ import absolute_import
10+
911
import math
1012
from jinja2 import Template
1113
from folium.six import text_type, binary_type
@@ -365,7 +367,7 @@ def __init__(self, colors, index=None, vmin=0., vmax=1., caption=""):
365367
if index is None:
366368
self.index = [vmin + (vmax-vmin)*i*1./(n-1) for i in range(n)]
367369
else:
368-
self.index = list(index).copy()
370+
self.index = [x for x in index]
369371
self.colors = [_parse_color(x) for x in colors]
370372

371373
def rgba_floats_tuple(self, x):
@@ -525,7 +527,7 @@ def __init__(self, colors, index=None, vmin=0., vmax=1., caption=""):
525527
if index is None:
526528
self.index = [vmin + (vmax-vmin)*i*1./n for i in range(n+1)]
527529
else:
528-
self.index = list(index).copy()
530+
self.index = [x for x in index]
529531
self.colors = [_parse_color(x) for x in colors]
530532

531533
def rgba_floats_tuple(self, x):

0 commit comments

Comments
 (0)