summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-05-17 18:09:21 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-05-20 09:18:56 +0000
commit826821658df16b18a51ec0c0a6e54f7e3e31795c (patch)
tree70464a0e661c78a415ac3d1b7299aabf60c918ad /util
parentc454e622a1d50f4e6a879390241034b910e5ee90 (diff)
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 <tobias.hunger@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index ddfa7d05c3..5c5569ae30 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]: