aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/qfp_tool.py
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2024-06-06 10:59:31 +0200
committerAdrian Herrmann <adrian.herrmann@qt.io>2024-06-20 16:10:46 +0000
commitba2582125f6c9d470d3a5f4e1e61666de9101e0e (patch)
treecb04e0b4a90e02e0d6026309447fbcf08a8e00a0 /build_scripts/qfp_tool.py
parent7bb9c0e2f81ec474bf98690b4f90f195a6ea27c8 (diff)
Use modern typing syntax
We can already use the modern typing syntax introduced with Python 3.10 in 3.9 via future statement definitions, even before we raise the minimum Python version to 3.10. Note that direct expressions with "|" don't work yet. Task-number: PYSIDE-2786 Change-Id: Ie36c140fc960328322502ea29cf6868805a7c558 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'build_scripts/qfp_tool.py')
-rw-r--r--build_scripts/qfp_tool.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/build_scripts/qfp_tool.py b/build_scripts/qfp_tool.py
index 7ad83746e..153712d89 100644
--- a/build_scripts/qfp_tool.py
+++ b/build_scripts/qfp_tool.py
@@ -12,7 +12,6 @@ import warnings
from argparse import ArgumentParser, RawTextHelpFormatter
from enum import Enum, auto
from pathlib import Path
-from typing import List
DESC = """
Utility script for working with Qt for Python.
@@ -102,14 +101,14 @@ def which(needle: str):
return None
-def command_log_string(args: List[str], directory: Path):
+def command_log_string(args: list[str], directory: Path):
result = f'[{directory.name}]'
for arg in args:
result += f' "{arg}"' if ' ' in arg else f' {arg}'
return result
-def execute(args: List[str]):
+def execute(args: list[str]):
"""Execute a command and print to log"""
log_string = command_log_string(args, Path.cwd())
print(log_string)