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:
parent
fa2a7c502d
commit
f3f392ef66
13 changed files with 51 additions and 60 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue