Add stacklevel=2 to warnings.warn() calls.
authorZac Medico <zmedico@gentoo.org>
Fri, 19 Feb 2010 22:14:57 +0000 (22:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 19 Feb 2010 22:14:57 +0000 (22:14 -0000)
svn path=/main/trunk/; revision=15405

pym/portage/__init__.py

index 654dc2c458c8b4b2816d97b9cf502b4d4f74a124..16fe15e48ec66b25d42bf3d49d17c02a61f5af35 100644 (file)
@@ -3680,7 +3680,7 @@ class config(object):
        def has_key(self,mykey):
                warnings.warn("portage.config.has_key() is deprecated, "
                        "use the in operator instead",
-                       DeprecationWarning)
+                       DeprecationWarning, stacklevel=2)
                return mykey in self
 
        def __contains__(self, mykey):
@@ -8461,7 +8461,7 @@ def cpv_getkey(mycpv):
                return mysplit[0] + '/' + mysplit[1]
 
        warnings.warn("portage.cpv_getkey() called with invalid cpv: '%s'" \
-               % (mycpv,), DeprecationWarning)
+               % (mycpv,), DeprecationWarning, stacklevel=2)
 
        myslash = mycpv.split("/", 1)
        mysplit = versions._pkgsplit(myslash[-1])