diff --git a/src/modules/services-systemd/main.py b/src/modules/services-systemd/main.py
index ef2984fbae4df2fc1d18e35694c02ce4ff13d729..19c5974d645aa7028860aba9747452884c276091 100644
--- a/src/modules/services-systemd/main.py
+++ b/src/modules/services-systemd/main.py
@@ -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"]