Skip to content

Commit 2cce443

Browse files
committed
use OrderedDict in byteify
1 parent ab4f708 commit 2cce443

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

dash/development/component_generator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,13 @@ def cli():
146146
# pylint: disable=undefined-variable
147147
def byteify(input_object):
148148
if isinstance(input_object, dict):
149-
return {byteify(key): byteify(value)
150-
for key, value in input_object.iteritems()}
149+
return OrderedDict([
150+
(byteify(key), byteify(value))
151+
for key, value in input_object.iteritems()
152+
])
151153
elif isinstance(input_object, list):
152154
return [byteify(element) for element in input_object]
153-
elif isinstance(input_object, unicode): # noqa:F821
155+
elif isinstance(input_object, unicode): # noqa:F821
154156
return input_object.encode('utf-8')
155157
return input_object
156158

0 commit comments

Comments
 (0)