From 8ce4d053ceb0861b56305cdd2e001e864b02f9c2 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Mon, 8 Feb 2021 16:47:54 +0100 Subject: Switch from os.path to pathlib.Path, all source changes but tests With this patch, os.path in Shiboken and Pyside will be completely removed from sources. The rest will be done later. Task-number: PYSIDE-1499 Change-Id: Id01782779487ceec62efdd1f32f65beee0234338 Reviewed-by: Friedemann Kleint --- sources/pyside6/doc/tutorials/qmlintegration/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sources/pyside6/doc/tutorials/qmlintegration/main.py') diff --git a/sources/pyside6/doc/tutorials/qmlintegration/main.py b/sources/pyside6/doc/tutorials/qmlintegration/main.py index 884d239b3..24a801851 100644 --- a/sources/pyside6/doc/tutorials/qmlintegration/main.py +++ b/sources/pyside6/doc/tutorials/qmlintegration/main.py @@ -39,7 +39,8 @@ ############################################################################# import sys -from os.path import abspath, dirname, join +import os +from pathlib import Path from PySide6.QtCore import QObject, Slot from PySide6.QtGui import QGuiApplication @@ -104,8 +105,8 @@ if __name__ == '__main__': # Get the path of the current directory, and then add the name # of the QML file, to load it. - qmlFile = join(dirname(__file__), 'view.qml') - engine.load(abspath(qmlFile)) + qmlFile = Path(__file__).parent / 'view.qml' + engine.load(os.fspath(qmlFile.resolve())) if not engine.rootObjects(): sys.exit(-1) -- cgit v1.2.3