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 5fe8a38af3

Change-Id: I2a4d5c5cb5b460bf02b6da02d42d8cc8d5eb4192
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Alexandru Croitor 2019-05-17 18:09:21 +02:00
parent c454e622a1
commit 826821658d

View File

@ -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]: