diff --git a/dash/development/_r_components_generation.py b/dash/development/_r_components_generation.py index 485e4f6478..389dd47125 100644 --- a/dash/development/_r_components_generation.py +++ b/dash/development/_r_components_generation.py @@ -161,7 +161,8 @@ def generate_class_string(name, props, project_shortname, prefix): # Filter props to remove those we don't want to expose for item in prop_keys[:]: if item.endswith('-*') \ - or item in r_keywords + ['setProps']: + or item in r_keywords \ + or item == 'setProps': prop_keys.remove(item) default_argtext += ", ".join( diff --git a/dash/development/component_generator.py b/dash/development/component_generator.py index 16cb3c093f..8fb0c036b9 100644 --- a/dash/development/component_generator.py +++ b/dash/development/component_generator.py @@ -136,13 +136,17 @@ def cli(): rprefix=args.r_prefix) +# pylint: disable=undefined-variable def byteify(input_object): if isinstance(input_object, dict): return {byteify(key): byteify(value) for key, value in input_object.iteritems()} elif isinstance(input_object, list): return [byteify(element) for element in input_object] - elif isinstance(input_object, unicode): + elif sys.version_info[0] >= 3: + if isinstance(input_object, str): + return input_object.encode('utf-8') + elif isinstance(input_object, unicode): # noqa:F821 return input_object.encode('utf-8') return input_object