diff options
| author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2022-10-13 12:36:23 +0200 |
|---|---|---|
| committer | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2022-10-18 11:34:52 +0200 |
| commit | 2afcf8e7545c681e412e5b6d04ab8867e5edd5c7 (patch) | |
| tree | 060e956fa8aa99301a60bab605b2fd3d3ed19f13 /build_scripts/config.py | |
| parent | 7f2c40d9b32b7b7b161d224c483b1fe23270c446 (diff) | |
pathlib: migrate build_scripts away from os.path
There is a usage of os.path.relpath that cannot be migrated
to pathlib, which remain the only usage of os.path
Task-number: PYSIDE-2080
Change-Id: Iac781e9c9324fb8b9d3559b4225912d56782072a
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'build_scripts/config.py')
| -rw-r--r-- | build_scripts/config.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/build_scripts/config.py b/build_scripts/config.py index 285739456..11967ba06 100644 --- a/build_scripts/config.py +++ b/build_scripts/config.py @@ -4,6 +4,8 @@ import os from .log import log +from pathlib import Path + from .versions import PYSIDE, PYSIDE_MODULE, SHIBOKEN @@ -97,7 +99,7 @@ class Config(object): else: self.build_type = self._build_type_all - self.setup_script_dir = setup_script_dir + self.setup_script_dir = Path(setup_script_dir) self.cmake_toolchain_file = cmake_toolchain_file @@ -222,7 +224,7 @@ class Config(object): content = '' changes = '' try: - with open(os.path.join(self.setup_script_dir, readme_filename)) as f: + with open(self.setup_script_dir / readme_filename) as f: readme = f.read() except Exception as e: log.error(f"Couldn't read contents of {readme_filename}. {e}") @@ -233,7 +235,7 @@ class Config(object): include_changes = False if include_changes: try: - with open(os.path.join(self.setup_script_dir, changes_filename)) as f: + with open(self.setup_script_dir / changes_filename) as f: changes = f.read() except Exception as e: log.error(f"Couldn't read contents of {changes_filename}. {e}") |
