From a3dda34785a68e43511dbe0f2b2c35d780fa3d62 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Sun, 25 Jun 2023 21:36:49 +0200 Subject: [PATCH] pmb.config: Use Python 3.8-compatible type annotation The 'list' type annotation only works from Python 3.9 and since we still support Python 3.7 we should use the version from the typing package instead. Closes: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2247 Fixes: d31313f7 ("Don't use 'sudo' when running as root") Reviewed-by: Oliver Smith Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230625193650.528651-1-luca@z3ntu.xyz%3E --- pmb/config/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 6aa52788..85e2f753 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -4,6 +4,7 @@ import multiprocessing import os import pmb.parse.arch import sys +from typing import List # # Exported functions @@ -60,7 +61,7 @@ required_programs = [ ] -def sudo(cmd: list[str]) -> list[str]: +def sudo(cmd: List[str]) -> List[str]: """Adapt a command to run as root.""" sudo = which_sudo() if sudo: