Skip to content

Commit ade9e1f

Browse files
committed
Small changes to make the code Python 3 compatible.
modified: svgwidgets.py
1 parent 2dda32e commit ade9e1f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

svgwidgets.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def __init__(self, **kwargs):
240240

241241
svg_class_dict = {}
242242

243-
for class_name in filter(lambda name: name.endswith("Widget"), locals()):
243+
widget_class_names = list(filter(lambda name: name.endswith("Widget"), locals()))
244+
245+
for class_name in widget_class_names:
244246

245247
this_module = sys.modules[__name__]
246248
klass = getattr(this_module,class_name)
@@ -280,7 +282,7 @@ def __init__(self, **kwargs):
280282

281283

282284
# now define the trailets with the correct traitlet.Type
283-
for name,default in traitlets_dict.iteritems():
285+
for name,default in traitlets_dict.items():
284286

285287
try:
286288
default = float(default)
@@ -309,7 +311,7 @@ def __init__(self, **kwargs):
309311
"fertile" : klass.fertile,
310312
"view_name" : class_name.replace("Widget","View"),
311313
"attributes" : klass.attributes,
312-
"draggable" : klass.draggable} for class_name,klass in svg_class_dict.iteritems() }
314+
"draggable" : klass.draggable} for class_name,klass in svg_class_dict.items() }
313315

314316

315317
# set data in global scope

0 commit comments

Comments
 (0)