~postmarketos/pmbootstrap-devel

pmbootstrap: pmb.config.sudo: Use type union compatible with Python 3.7 v2 SUPERSEDED

Newbyte: 1
 pmb.config.sudo: Use type union compatible with Python 3.7

 1 files changed, 2 insertions(+), 1 deletions(-)
#1001509 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/41645/mbox | git am -3
Learn more about email & git

[PATCH pmbootstrap v2] pmb.config.sudo: Use type union compatible with Python 3.7 Export this patch

The Type | OtherType syntax for writing unions was introduced in Python
3.10. We want to support Python 3.7, so use the old syntax which is
supported by it.

Fixes d31313f7dc8018aeb92eeb8caf2dccf71a443a43
---
 pmb/config/sudo.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pmb/config/sudo.py b/pmb/config/sudo.py
index 1e227534..5ce2e9ac 100644
--- a/pmb/config/sudo.py
+++ b/pmb/config/sudo.py
@@ -3,10 +3,11 @@
import os
import shutil
from functools import lru_cache
from typing import Union


@lru_cache()
def which_sudo() -> str | None:
def which_sudo() -> Union[str, None]:
    """Returns a command required to run commands as root, if any.

    Find whether sudo or doas is installed for commands that require root.
-- 
2.40.1
pmbootstrap/patches/.build.yml: SUCCESS in 20m35s

[pmb.config.sudo: Use type union compatible with Python 3.7][0] v2 from [Newbyte][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/41645
[1]: mailto:newbyte@postmarketos.org

✓ #1001509 SUCCESS pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/1001509