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 <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230625193650.528651-1-luca@z3ntu.xyz%3E
This commit is contained in:
Luca Weiss 2023-06-25 21:36:49 +02:00 committed by Oliver Smith
parent 620f3af691
commit a3dda34785
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 2 additions and 1 deletions

View File

@ -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: