From 826821658df16b18a51ec0c0a6e54f7e3e31795c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 18:09:21 +0200 Subject: [PATCH] Workaround fix in pro2cmake Operation __init__ method There are still call sites that call Operation.__init__ with a string instead of a list. Restore the handling of such a case. Amends 5fe8a38af34d1530f14c3b695dee5a33e4a85554 Change-Id: I2a4d5c5cb5b460bf02b6da02d42d8cc8d5eb4192 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ddfa7d05c37..5c5569ae30f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -206,8 +206,11 @@ def handle_vpath(source: str, base_dir: str, vpath: typing.List[str]) -> str: class Operation: - def __init__(self, value: typing.List[str]): - self._value = value + def __init__(self, value: typing.Union[typing.List[str], str]): + if isinstance(value, list): + self._value = value + else: + self._value = [str(value), ] def process(self, key: str, input: typing.List[str], transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: