diff options
author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2022-06-27 20:02:34 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-28 14:07:50 +0000 |
commit | 5cc0ba1366ccc7855cf92f901b1efeb6ffadb021 (patch) | |
tree | 522eba7f8275d236140c259143cab5631b8b724d | |
parent | 61c3d9f7915b2cbda0a90886a03d4095c8ca8ac5 (diff) |
build: avoid mutable default value as argument
Mainly to avoid having a persistent object every time
we call the function, to avoid future issues.
Change-Id: I9aea45ffa7ecd381e8c5ed6b3c83036d6e8aef72
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 50c746d61fdf521e98557ec34dc21f9413c2a465)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | build_scripts/qtinfo.py | 8 | ||||
-rw-r--r-- | build_scripts/utils.py | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/build_scripts/qtinfo.py b/build_scripts/qtinfo.py index cb4b56950..95b20d14f 100644 --- a/build_scripts/qtinfo.py +++ b/build_scripts/qtinfo.py @@ -162,7 +162,9 @@ class QtInfo(object): return None return self._query_dict[prop_name] - def _get_qtpaths_output(self, args_list=[], cwd=None): + def _get_qtpaths_output(self, args_list=None, cwd=None): + if args_list is None: + args_list = [] assert self._qtpaths_command cmd = [self._qtpaths_command] cmd.extend(args_list) @@ -175,7 +177,9 @@ class QtInfo(object): return output # FIXME PYSIDE7: Remove qmake handling - def _get_qmake_output(self, args_list=[], cwd=None): + def _get_qmake_output(self, args_list=None, cwd=None): + if args_list is None: + args_list = [] assert self._qmake_command cmd = [self._qmake_command] cmd.extend(args_list) diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 6f13ce426..fb400b755 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -651,8 +651,8 @@ def macos_fix_rpaths_for_library(library_path, qt_lib_dir): macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands, install_names) -def macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands=[], - library_dependencies=[]): +def macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands=None, + library_dependencies=None): """ Adds an rpath load command to the Qt lib directory if necessary @@ -660,6 +660,12 @@ def macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands=[], and adds an rpath load command that points to the Qt lib directory (qt_lib_dir). """ + if existing_rpath_commands is None: + existing_rpath_commands = [] + + if library_dependencies is None: + library_dependencies = [] + if not existing_rpath_commands: existing_rpath_commands = macos_get_rpaths(library_path) |