Fix flake error.
@@ -312,21 +312,21 @@ def map_struct(func, struct, cls=None, map_dict=True, map_list=True, map_tuple=F
if isinstance(struct, (types.GeneratorType, ValuesView)):
struct = list(struct)
- types = tuple()
+ valid_types = tuple()
if map_dict:
- types = types + (dict,)
+ valid_types = valid_types + (dict,)
if isinstance(map_dict, int) and not isinstance(map_dict, bool):
map_dict -= 1
if map_list:
- types = types + (list,)
+ valid_types = valid_types + (list,)
if isinstance(map_list, int) and not isinstance(map_list, bool):
map_list -= 1
if map_tuple:
- types = types + (tuple,)
+ valid_types = valid_types + (tuple,)
if isinstance(map_tuple, int) and not isinstance(map_tuple, bool):
map_tuple -= 1
if map_set:
- types = types + (set,)
+ valid_types = valid_types + (set,)
if isinstance(map_set, int) and not isinstance(map_set, bool):
map_set -= 1
@@ -335,7 +335,7 @@ def map_struct(func, struct, cls=None, map_dict=True, map_list=True, map_tuple=F
return func(struct)
# traverse?
- elif isinstance(struct, types):
+ elif isinstance(struct, valid_types):
# create a new struct, treat tuples as lists for itertative item appending
new_struct = struct.__class__() if not isinstance(struct, tuple) else []
