Add a deprecation warning to FetchlistDict.has_key().
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 13:46:56 +0000 (06:46 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 13:46:56 +0000 (06:46 -0700)
pym/portage/dbapi/porttree.py

index a604260b28960fb8cfd19cfd09db9b0c9d9739d0..dab75b2780691ace85dabffa92b97aa4d51c2284 100644 (file)
@@ -1160,6 +1160,9 @@ class FetchlistDict(Mapping):
 
        def has_key(self, pkg_key):
                """Returns true if the given package exists within pkgdir."""
+               warnings.warn("portage.dbapi.porttree.FetchlistDict.has_key() is "
+                       "deprecated, use the 'in' operator instead",
+                       DeprecationWarning, stacklevel=2)
                return pkg_key in self
 
        def __iter__(self):