From a8a2476b73968fbc973704af36955ac9be010d5d Mon Sep 17 00:00:00 2001 From: Michal Hecko Date: Wed, 14 Aug 2024 23:39:59 +0200 Subject: [PATCH] add_upgrade_boot_entry: make sure to not expand unicode --- .../addupgradebootentry/libraries/addupgradebootentry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py index 3b6e67c94d..37e1237a02 100644 --- a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py +++ b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py @@ -59,12 +59,12 @@ def fmt_single_arg(arg_pair): def flatten_arguments(arg_pair): """ Expand multi-valued values into an iterable (key, value1), (key, value2) """ key, value = arg_pair - if isinstance(value, str) or value is None: - yield (key, value) # Just a single (key, value) pair - else: + if isinstance(value, (tuple, list)): # value is multi-valued (a tuple of values) for value_elem in value: # yield from is not available in python2.7 yield (key, value_elem) + else: + yield (key, value) # Just a single (key, value) pair arg_sequence = itertools.chain(*(flatten_arguments(arg_pair) for arg_pair in args_dict.items()))