Skip to content

Commit

Permalink
[services-systemd] Correct Python key-checking
Browse files Browse the repository at this point in the history
`has_key()` is a Python2-era form; use the `in` operator insteda.
  • Loading branch information
adriaandegroot committed Sep 9, 2022
1 parent 6235e04 commit d1664f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/services-systemd/main.py
Expand Up @@ -42,7 +42,7 @@ def systemctl(units):
action = "enable"
mandatory = False
else:
if not unit.has_key("name"):
if "name" not in unit:
libcalamares.utils.error("The key 'name' is missing from the mapping {_unit!s}. Continuing to the next unit.".format(_unit=str(unit)))
continue
name = unit["name"]
Expand Down

0 comments on commit d1664f3

Please sign in to comment.