Patchwork D2210: util: call warnings.warn() with a sysstr in nouideprecwarn

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 3:30 a.m.
Message ID <differential-rev-PHID-DREV-qmqibltti2fquj5pbeer-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27784/
State Superseded
Headers show

Comments

phabricator - Feb. 13, 2018, 3:30 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This preserves nouideprecwarn wanting a bytes, which is consistent
  with the rest of hg.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -253,7 +253,7 @@ 
     if _dowarn:
         msg += ("\n(compatibility will be dropped after Mercurial-%s,"
                 " update your code.)") % version
-        warnings.warn(msg, DeprecationWarning, stacklevel + 1)
+        warnings.warn(pycompat.sysstr(msg), DeprecationWarning, stacklevel + 1)
 
 DIGESTS = {
     'md5': hashlib.md5,