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:
parent
620f3af691
commit
a3dda34785
|
@ -4,6 +4,7 @@ import multiprocessing
|
||||||
import os
|
import os
|
||||||
import pmb.parse.arch
|
import pmb.parse.arch
|
||||||
import sys
|
import sys
|
||||||
|
from typing import List
|
||||||
|
|
||||||
#
|
#
|
||||||
# Exported functions
|
# 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."""
|
"""Adapt a command to run as root."""
|
||||||
sudo = which_sudo()
|
sudo = which_sudo()
|
||||||
if sudo:
|
if sudo:
|
||||||
|
|
Loading…
Reference in New Issue