]> err.no Git - dak/commitdiff
config.py: Add __contains__ method
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 14 Jun 2012 17:38:31 +0000 (19:38 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 1 Jul 2012 11:17:29 +0000 (13:17 +0200)
daklib/config.py

index 7e3c8bac582baf895a8a3b7f2b08d39d5619566c..1e9299f21bbd9e5e004741215e89771d20312b00 100755 (executable)
@@ -85,7 +85,10 @@ class Config(object):
         self.find_b = self.Cnf.find_b
 
     def has_key(self, name):
-        return self.Cnf.has_key(name)
+        return name in self.Cnf
+
+    def __contains__(self, name):
+        return name in self.Cnf
 
     def __getitem__(self, name):
         return self.Cnf[name]