diff --git a/DDCore/python/dd4hepFactories.py b/DDCore/python/dd4hepFactories.py
index 71eba0ba1d97cb3610b0b34f05d5a96fbeffee79..7995161a971990a207727f4fdaf84337b3d629c7 100755
--- a/DDCore/python/dd4hepFactories.py
+++ b/DDCore/python/dd4hepFactories.py
@@ -56,7 +56,7 @@ class ComponentDumper:
         component_count = 0
         duplicate_count = 0
         for lib, comp in self.all_components:
-            if entries.has_key(comp):
+            if comp in entries:
                 dupl = entries[comp]
                 if dupl[1] == 0:
                     if not summary_only:
@@ -79,7 +79,7 @@ class ComponentDumper:
         library_count = 0
         component_count = 0
         for lib, comp in self.all_components:
-            if not entries.has_key(lib):
+            if lib not in entries:
                 entries[lib] = [comp]
                 library_count = library_count + 1
                 component_count = component_count + 1
diff --git a/DDG4/python/DDG4.py b/DDG4/python/DDG4.py
index 0f64cb3a9fccbea06b4237d412da0b7b090ab893..b009bd0371e7ba6af2b86c9fded52a85c5ebd15d 100644
--- a/DDG4/python/DDG4.py
+++ b/DDG4/python/DDG4.py
@@ -517,7 +517,7 @@ class Geant4:
       if sd.isValid():
         typ = sd.type()
         sdtyp = 'Unknown'
-        if self.sensitive_types.has_key(typ):
+        if typ in self.sensitive_types:
           sdtyp = self.sensitive_types[typ]
         logger.info('+++  %-32s type:%-12s  --> Sensitive type: %s',o.name(), typ, sdtyp)
 
diff --git a/DDG4/python/g4MaterialScan.py b/DDG4/python/g4MaterialScan.py
index c5698a0d7b1b574a90be2335327c37a37c6843ec..8d58d8dbd93ce0b8eb81b4133c341627cacf7761 100644
--- a/DDG4/python/g4MaterialScan.py
+++ b/DDG4/python/g4MaterialScan.py
@@ -36,7 +36,7 @@ def materialScan(opts):
     sd = geant4.description.sensitiveDetector(o.name())
     if sd.isValid():
       typ = sd.type()
-      if geant4.sensitive_types.has_key(typ):
+      if typ in geant4.sensitive_types:
         geant4.setupDetector(o.name(),geant4.sensitive_types[typ])
         sdtyp = geant4.sensitive_types[typ]
       else: