From bf7ca72d74ec580b666e763da8160dfaf17074ee Mon Sep 17 00:00:00 2001 From: Martin Journois Date: Sun, 10 Jan 2016 21:01:25 +0100 Subject: [PATCH] Fix colormap import error in python2 --- folium/colormap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/folium/colormap.py b/folium/colormap.py index 1d1e0d8759..bc8b9e73d1 100644 --- a/folium/colormap.py +++ b/folium/colormap.py @@ -6,6 +6,8 @@ Utility module for dealing with colormaps. """ +from __future__ import absolute_import + import math from jinja2 import Template from folium.six import text_type, binary_type @@ -365,7 +367,7 @@ def __init__(self, colors, index=None, vmin=0., vmax=1., caption=""): if index is None: self.index = [vmin + (vmax-vmin)*i*1./(n-1) for i in range(n)] else: - self.index = list(index).copy() + self.index = [x for x in index] self.colors = [_parse_color(x) for x in colors] def rgba_floats_tuple(self, x): @@ -525,7 +527,7 @@ def __init__(self, colors, index=None, vmin=0., vmax=1., caption=""): if index is None: self.index = [vmin + (vmax-vmin)*i*1./n for i in range(n+1)] else: - self.index = list(index).copy() + self.index = [x for x in index] self.colors = [_parse_color(x) for x in colors] def rgba_floats_tuple(self, x):