From 6f71d5c3f8fa7133fbd2679f81c07846d7e9b610 Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Wed, 15 Oct 2014 13:38:05 -0700 Subject: [PATCH] Refactor dict comprehension which doesn't exist in python 2.6. --- plotly/graph_objs/graph_objs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plotly/graph_objs/graph_objs.py b/plotly/graph_objs/graph_objs.py index b22984db278..41d55b43676 100644 --- a/plotly/graph_objs/graph_objs.py +++ b/plotly/graph_objs/graph_objs.py @@ -1060,8 +1060,10 @@ def force_clean(self, caller=True): # TODO: can't make call to super... # (4) NAME_TO_CLASS dict and class-generating function -NAME_TO_CLASS = {name: getattr(sys.modules[__name__], name) - for name in NAME_TO_KEY.keys()} +# NOTE: used to be a dict comprehension, but we try and support 2.6.x now +NAME_TO_CLASS = {} +for name in NAME_TO_KEY.keys(): + NAME_TO_CLASS[name] = getattr(sys.modules[__name__], name) def get_class_instance_by_name(name, *args, **kwargs):