Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 37455:9ecb7c471cfb
py3: silence warning about deprecation of imp module
Well, we could fix that, but we aren't yet to reach the state caring about
deprecation on the Python 3 line. So let's silence it for now to fix tons
of "minor" Py2/3 incompatibilities by relying on our test suite.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 07 Apr 2018 13:21:59 +0900 |
parents | de9f9f888900 |
children | 1765ed63db40 |
comparison
equal
deleted
inserted
replaced
37454:0a9751ece252 | 37455:9ecb7c471cfb |
---|---|
191 if _dowarn and pycompat.ispy3: | 191 if _dowarn and pycompat.ispy3: |
192 # silence warning emitted by passing user string to re.sub() | 192 # silence warning emitted by passing user string to re.sub() |
193 warnings.filterwarnings(r'ignore', r'bad escape', DeprecationWarning, | 193 warnings.filterwarnings(r'ignore', r'bad escape', DeprecationWarning, |
194 r'mercurial') | 194 r'mercurial') |
195 warnings.filterwarnings(r'ignore', r'invalid escape sequence', | 195 warnings.filterwarnings(r'ignore', r'invalid escape sequence', |
196 DeprecationWarning, r'mercurial') | |
197 # TODO: reinvent imp.is_frozen() | |
198 warnings.filterwarnings(r'ignore', r'the imp module is deprecated', | |
196 DeprecationWarning, r'mercurial') | 199 DeprecationWarning, r'mercurial') |
197 | 200 |
198 def nouideprecwarn(msg, version, stacklevel=1): | 201 def nouideprecwarn(msg, version, stacklevel=1): |
199 """Issue an python native deprecation warning | 202 """Issue an python native deprecation warning |
200 | 203 |