Small fix to correctly handle default arguments
Dictionaries are mutable, and should not be assigned as a default parameter. Change-Id: Id08c17f89c17b404560241849603e1e1a0ec6562 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
97b76704ea
commit
cb370593df
@ -374,10 +374,14 @@ class Scope(object):
|
|||||||
parent_scope: typing.Optional[Scope],
|
parent_scope: typing.Optional[Scope],
|
||||||
file: typing.Optional[str] = None, condition: str = '',
|
file: typing.Optional[str] = None, condition: str = '',
|
||||||
base_dir: str = '',
|
base_dir: str = '',
|
||||||
operations: typing.Mapping[str, typing.List[Operation]] = {
|
operations: typing.Union[
|
||||||
'QT_SOURCE_TREE': [SetOperation(['${QT_SOURCE_TREE}'])],
|
typing.Mapping[str, typing.List[Operation]], None] = None) -> None:
|
||||||
'QT_BUILD_TREE': [SetOperation(['${PROJECT_BUILD_DIR}'])],
|
if operations is None:
|
||||||
}) -> None:
|
operations = {
|
||||||
|
'QT_SOURCE_TREE': [SetOperation(['${QT_SOURCE_TREE}'])],
|
||||||
|
'QT_BUILD_TREE': [SetOperation(['${PROJECT_BUILD_DIR}'])],
|
||||||
|
}
|
||||||
|
|
||||||
self._operations = copy.deepcopy(operations)
|
self._operations = copy.deepcopy(operations)
|
||||||
if parent_scope:
|
if parent_scope:
|
||||||
parent_scope._add_child(self)
|
parent_scope._add_child(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user