1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-25 13:35:09 +03:00

Use simplified Python 3.8 syntax (MR 2327)

This commit was generated with:

    ruff check --fix --extend-select=UP .
This commit is contained in:
Hugo Osvaldo Barrera 2024-06-23 14:38:19 +02:00 committed by Oliver Smith
parent fa2a7c502d
commit f3f392ef66
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
13 changed files with 51 additions and 60 deletions

View file

@ -84,7 +84,7 @@ def migrate_work_folder(args: PmbArgs):
current = 0
path = context.config.work / "version"
if os.path.exists(path):
with open(path, "r") as f:
with open(path) as f:
current = int(f.read().rstrip())
# Compare version, print warning or do nothing
@ -168,7 +168,7 @@ def migrate_work_folder(args: PmbArgs):
# Require git, set cache_git ownership
pmb.config.init.require_programs()
if os.path.exists(path):
uid_gid = "{}:{}".format(os.getuid(), os.getgid())
uid_gid = f"{os.getuid()}:{os.getgid()}"
pmb.helpers.run.root(["chown", "-R", uid_gid, path])
else:
os.makedirs(path, 0o700, True)