aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/bld_module.py
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2023-01-13 13:02:20 +0200
committerPatrik Teivonen <patrik.teivonen@qt.io>2023-01-13 13:44:17 +0000
commiteea9ede493a73c9518e07a6b9dcff597f70a2c2a (patch)
tree74ed2f614cb682c4756cdcf0a1ac58cce6582f77 /packaging-tools/bld_module.py
parent5687b7451e810a8bcc5d5fce69388b99a592ad0f (diff)
PL119: os.path.basename("foo/bar") should be replaced by bar_path.name
Get basename of a path using pathlib.Path.name. Enable PL119 in flake8. Update copyright year for changed files. Change-Id: Ice7cd7e9246950dd39321b108bb68c9466f62189 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
Diffstat (limited to 'packaging-tools/bld_module.py')
-rwxr-xr-xpackaging-tools/bld_module.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/packaging-tools/bld_module.py b/packaging-tools/bld_module.py
index 11c462ced..269df9802 100755
--- a/packaging-tools/bld_module.py
+++ b/packaging-tools/bld_module.py
@@ -3,7 +3,7 @@
#############################################################################
#
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2023 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of the release tools of the Qt Toolkit.
@@ -132,7 +132,7 @@ def main() -> None:
formatter_class=argparse.RawTextHelpFormatter
)
if is_windows():
- parser.epilog = f"example on windows: {os.linesep}\tpython {os.path.basename(sys.argv[0])} --clean " \
+ parser.epilog = f"example on windows: {os.linesep}\tpython {Path(sys.argv[0]).name} --clean " \
"--buildcommand C:\\bin\\ibjom.cmd" \
"--qt5_module_url <uri to qt5_essentials.7z> " \
"--qt5_module_url <uri to qt5_addons.7z> " \
@@ -141,7 +141,7 @@ def main() -> None:
"--module_branch <module branch>" \
"--module_dir <Local copy of module>"
elif is_macos():
- parser.epilog = f"example: {os.linesep}\tpython {os.path.basename(sys.argv[0])} --clean " \
+ parser.epilog = f"example: {os.linesep}\tpython {Path(sys.argv[0]).name} --clean " \
"--qt5_module_url <uri to qt5_essentials.7z> " \
"--qt5_module_url <uri to qt5_addons.7z> " \
"--qt5_module_url <uri to qt5_webengine.7z> " \
@@ -149,7 +149,7 @@ def main() -> None:
"--module_branch <module branch>" \
"--module_dir <Local copy of module>"
else:
- parser.epilog = f"example: {os.linesep}\tpython {os.path.basename(sys.argv[0])} --clean " \
+ parser.epilog = f"example: {os.linesep}\tpython {Path(sys.argv[0]).name} --clean " \
"--qt5_module_url <uri to qt5_essentials.7z> " \
"--qt5_module_url <uri to qt5_addons.7z> " \
"--qt5_module_url <uri to qt5_webengine.7z> " \
@@ -366,7 +366,7 @@ def main() -> None:
raise RuntimeError(f"Failure running the last command: {ret}")
# try to figure out where the actual exported content is
- qt5_install_basename = os.path.basename(caller_arguments.qt5path)
+ qt5_install_basename = Path(caller_arguments.qt5path).name
if caller_arguments.use_cmake:
dir_to_archive = qt_module_install_directory