Patchwork D3331: util: set correct stack level on deprecation warnings

login
register
mail settings
Submitter phabricator
Date April 14, 2018, 8:12 a.m.
Message ID <dda03991e4da8e20fcabc59f96216847@localhost.localdomain>
Download mbox | patch
Permalink /patch/31006/
State Not Applicable
Headers show

Comments

phabricator - April 14, 2018, 8:12 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5b8a260769a2: util: set correct stack level on deprecation warnings (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3331?vs=8151&id=8257

REVISION DETAIL
  https://phab.mercurial-scm.org/D3331

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -3781,7 +3781,7 @@ 
         fn = pycompat.sysbytes(func.__name__)
         mn = modname or pycompat.sysbytes(func.__module__)[len('mercurial.'):]
         msg = "'util.%s' is deprecated, use '%s.%s'" % (fn, mn, fn)
-        nouideprecwarn(msg, version)
+        nouideprecwarn(msg, version, stacklevel=2)
         return func(*args, **kwargs)
     wrapped.__name__ = func.__name__
     return wrapped