Skip to content

Commit 5e251f0

Browse files
author
Ryan Patrick Kyle
committed
2️⃣3️⃣ attempt to preserve version compatibility
🚿 pylint edit 🚿 flake8 edit 🚿 flake8 edit 🐛 fixed TypeError
1 parent 8aa3f25 commit 5e251f0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dash/development/_r_components_generation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def generate_class_string(name, props, project_shortname, prefix):
161161
# Filter props to remove those we don't want to expose
162162
for item in prop_keys[:]:
163163
if item.endswith('-*') \
164-
or item in r_keywords + ['setProps']:
164+
or item in r_keywords \
165+
or item == 'setProps':
165166
prop_keys.remove(item)
166167

167168
default_argtext += ", ".join(

dash/development/component_generator.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,17 @@ def cli():
136136
rprefix=args.r_prefix)
137137

138138

139+
# pylint: disable=undefined-variable
139140
def byteify(input_object):
140141
if isinstance(input_object, dict):
141142
return {byteify(key): byteify(value)
142143
for key, value in input_object.iteritems()}
143144
elif isinstance(input_object, list):
144145
return [byteify(element) for element in input_object]
145-
elif isinstance(input_object, unicode):
146+
elif sys.version_info[0] >= 3:
147+
if isinstance(input_object, str):
148+
return input_object.encode('utf-8')
149+
elif isinstance(input_object, unicode): # noqa:F821
146150
return input_object.encode('utf-8')
147151
return input_object
148152

0 commit comments

Comments
 (0)