Patchwork D2642: util: also silence py3 warnings from codec module

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 4:56 p.m.
Message ID <differential-rev-PHID-DREV-voidjxlu33wycsbb3flk-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28930/
State Superseded
Headers show

Comments

phabricator - March 4, 2018, 4:56 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Fixes warnings like this:
  
  +  mercurial/util.py:2446: DeprecationWarning: invalid escape sequence '\d'
  +    return codecs.escape_decode(s)[0]

REPOSITORY
  rHG Mercurial

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

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
@@ -249,6 +249,8 @@ 
     # silence warning emitted by passing user string to re.sub()
     warnings.filterwarnings(r'ignore', r'bad escape', DeprecationWarning,
                             r'mercurial')
+    warnings.filterwarnings(r'ignore', r'invalid escape sequence',
+                            DeprecationWarning, r'mercurial')
 
 def nouideprecwarn(msg, version, stacklevel=1):
     """Issue an python native deprecation warning