aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2023-01-16 14:48:23 +0200
committerPatrik Teivonen <patrik.teivonen@qt.io>2023-01-24 08:16:29 +0000
commit815ed7e8b0083cbaf6919cc87a2e6e1dd6a62729 (patch)
treef50ed9b2bccc761217a223b487172e1cbec3db29
parentaf577fe8782e18188273e48c3ce3f475ac2debf4 (diff)
PL102: os.mkdir("foo") should be replaced by foo_path.mkdir()
Change-Id: Idcf807ffbb785066cfa5086efde2c755c0ad19fe Reviewed-by: Antti Kokko <antti.kokko@qt.io>
-rw-r--r--.pre-commit-config.yaml2
-rw-r--r--packaging-tools/bldinstallercommon.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 192220ce9..6d0e65e66 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,7 +15,7 @@ repos:
# Disable E203 for compatibility with blackformatter, and W503 as it goes against PEP8
# Disable checks that are not relevant to this patch, they will be introduced later
# - pathlib checks PLXXX
- entry: pipenv run python3 -m flake8 --max-line-length=99 --ignore=E203,E501,W503,PL100,PL102,PL103,PL104,PL106,PL107,PL110,PL112,PL113,PL114,PL115,PL116,PL117,PL118,PL120,PL123
+ entry: pipenv run python3 -m flake8 --max-line-length=99 --ignore=E203,E501,W503,PL100,PL103,PL104,PL106,PL107,PL110,PL112,PL113,PL114,PL115,PL116,PL117,PL118,PL120,PL123
language: system
types: [python]
fail_fast: true
diff --git a/packaging-tools/bldinstallercommon.py b/packaging-tools/bldinstallercommon.py
index b1e1475cd..05a8bee75 100644
--- a/packaging-tools/bldinstallercommon.py
+++ b/packaging-tools/bldinstallercommon.py
@@ -187,7 +187,7 @@ def move_tree(srcdir: str, dstdir: str, pattern: Optional[str] = None) -> None:
if not dstfname:
raise IOError('*** Fatal error! Unable to create destination file path, too long path name!')
if os.path.isdir(srcfname) and not os.path.islink(srcfname):
- os.mkdir(dstfname)
+ Path(dstfname).mkdir(parents=True, exist_ok=True)
move_tree(srcfname, dstfname)
elif pattern is None or fnmatch(name, pattern):
if os.path.islink(srcfname): # shutil.move fails moving directory symlinks over file system bounds...