Skip to content

Commit 1f1eb15

Browse files
committed
Merge pull request #126 from plotly/andrew-change-dict-comprehension
Refactor dict comprehension which doesn't exist in python 2.6.
2 parents a2cc735 + 6f71d5c commit 1f1eb15

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,8 +1060,10 @@ def force_clean(self, caller=True): # TODO: can't make call to super...
10601060

10611061

10621062
# (4) NAME_TO_CLASS dict and class-generating function
1063-
NAME_TO_CLASS = {name: getattr(sys.modules[__name__], name)
1064-
for name in NAME_TO_KEY.keys()}
1063+
# NOTE: used to be a dict comprehension, but we try and support 2.6.x now
1064+
NAME_TO_CLASS = {}
1065+
for name in NAME_TO_KEY.keys():
1066+
NAME_TO_CLASS[name] = getattr(sys.modules[__name__], name)
10651067

10661068

10671069
def get_class_instance_by_name(name, *args, **kwargs):

0 commit comments

Comments
 (0)