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

pym/portage/dbapi/bintree.py
pym/portage/dbapi/porttree.py

index 6f164ccb9abb0f81e26a521caeb1483a1eb7cb66..ce162fccb0e08d120ace2f207cbf8f437903d110 100644 (file)
@@ -457,7 +457,7 @@ class binarytree(object):
                        warnings.warn(
                                "portage.dbapi.bintree.binarytree.populate(): " + \
                                "getbinpkgsonly parameter is deprecated",
-                               DeprecationWarning)
+                               DeprecationWarning, stacklevel=2)
 
                if self._populating:
                        return
index f40d94d0bca94520ee5c278491f3e0eeb63b57b7..7cae96796fe7c668c9a919bb143aeabb4bf4ef6b 100644 (file)
@@ -171,7 +171,7 @@ class portdbapi(dbapi):
                                "portage.dbapi.porttree.portdbapi" + \
                                " constructor is now unused. Use " + \
                                "mysettings['PORTDIR'] instead.",
-                               DeprecationWarning)
+                               DeprecationWarning, stacklevel=2)
 
                # This is strictly for use in aux_get() doebuild calls when metadata
                # is generated by the depend phase.  It's safest to use a clone for