aboutsummaryrefslogtreecommitdiffstats
path: root/tools/checklibs.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-10-13 12:31:14 +0200
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-10-14 12:19:06 +0200
commita756860a6a0a86e72304ed24fb238f66e520a783 (patch)
treecf0e0f31f46b7289dbbea4aad9a7c210b0a58a32 /tools/checklibs.py
parent84bcb12d69bb24869f263839c26a13c858ca050d (diff)
pathlib: migrate tools away from os.path
Task-number: PYSIDE-2080 Change-Id: Id4a16e314df0f47e1a74001a23c825dbfa2956a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tools/checklibs.py')
-rw-r--r--tools/checklibs.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/checklibs.py b/tools/checklibs.py
index ed78daaf5..9a53beade 100644
--- a/tools/checklibs.py
+++ b/tools/checklibs.py
@@ -15,10 +15,10 @@
import collections
import optparse
-import os.path
import re
import subprocess
import sys
+from pathlib import Path
from pprint import pprint
@@ -183,23 +183,23 @@ class MachOFile:
if recorded_path.startswith(ImagePath.EXECUTABLE_PATH_TOKEN):
executable_image_path = self.executable_path()
if executable_image_path:
- path.resolved_path = os.path.normpath(
+ path.resolved_path = Path(
recorded_path.replace(
ImagePath.EXECUTABLE_PATH_TOKEN,
- os.path.dirname(executable_image_path.resolved_path)))
+ Path(executable_image_path.resolved_path).parent))
# handle @loader_path
elif recorded_path.startswith(ImagePath.LOADER_PATH_TOKEN):
- path.resolved_path = os.path.normpath(recorded_path.replace(
+ path.resolved_path = Path(recorded_path.replace(
ImagePath.LOADER_PATH_TOKEN,
- os.path.dirname(self.image_path.resolved_path)))
+ Path(self.image_path.resolved_path).parent))
# handle @rpath
elif recorded_path.startswith(ImagePath.RPATH_TOKEN):
for rpath in self.all_rpaths():
- resolved_path = os.path.normpath(recorded_path.replace(
+ resolved_path = Path(recorded_path.replace(
ImagePath.RPATH_TOKEN, rpath.resolved_path))
- if os.path.exists(resolved_path):
+ if resolved_path.exists():
path.resolved_path = resolved_path
path.rpath_source = rpath.rpath_source
break
@@ -302,7 +302,7 @@ class ImagePath:
return description
def exists(self):
- return self.resolved_path and os.path.exists(self.resolved_path)
+ return self.resolved_path and Path(self.resolved_path).exists()
def resolved_equals_recorded(self):
return (self.resolved_path and self.recorded_path and