Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 36699:aa9c5d447980
util: also silence py3 warnings from codec module
Fixes warnings like this:
+ mercurial/util.py:2446: DeprecationWarning: invalid escape sequence '\d'
+ return codecs.escape_decode(s)[0]
Differential Revision: https://phab.mercurial-scm.org/D2642
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 04 Mar 2018 11:49:33 -0500 |
parents | 8395fddde46c |
children | d77c3b023393 |
comparison
equal
deleted
inserted
replaced
36696:0c431d3129c4 | 36699:aa9c5d447980 |
---|---|
247 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext3rd') | 247 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext3rd') |
248 if _dowarn and pycompat.ispy3: | 248 if _dowarn and pycompat.ispy3: |
249 # silence warning emitted by passing user string to re.sub() | 249 # silence warning emitted by passing user string to re.sub() |
250 warnings.filterwarnings(r'ignore', r'bad escape', DeprecationWarning, | 250 warnings.filterwarnings(r'ignore', r'bad escape', DeprecationWarning, |
251 r'mercurial') | 251 r'mercurial') |
252 warnings.filterwarnings(r'ignore', r'invalid escape sequence', | |
253 DeprecationWarning, r'mercurial') | |
252 | 254 |
253 def nouideprecwarn(msg, version, stacklevel=1): | 255 def nouideprecwarn(msg, version, stacklevel=1): |
254 """Issue an python native deprecation warning | 256 """Issue an python native deprecation warning |
255 | 257 |
256 This is a noop outside of tests, use 'ui.deprecwarn' when possible. | 258 This is a noop outside of tests, use 'ui.deprecwarn' when possible. |