comparison mercurial/util.py @ 31952:a34b5e7c6683

util: pass sysstrs to warnings.filterwarnings Un-breaks the Python 3 build.
author Augie Fackler <augie@google.com>
date Thu, 13 Apr 2017 13:12:49 -0400
parents cc70c6dbac30
children 377c74ef008d 5f53c267e362
comparison
equal deleted inserted replaced
31951:f23d579a5a04 31952:a34b5e7c6683
166 # 166 #
167 # The option of setting PYTHONWARNINGS in the test runner was investigated. 167 # The option of setting PYTHONWARNINGS in the test runner was investigated.
168 # However, module name set through PYTHONWARNINGS was exactly matched, so 168 # However, module name set through PYTHONWARNINGS was exactly matched, so
169 # we cannot set 'mercurial' and have it match eg: 'mercurial.scmutil'. This 169 # we cannot set 'mercurial' and have it match eg: 'mercurial.scmutil'. This
170 # makes the whole PYTHONWARNINGS thing useless for our usecase. 170 # makes the whole PYTHONWARNINGS thing useless for our usecase.
171 warnings.filterwarnings('default', '', DeprecationWarning, 'mercurial') 171 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'mercurial')
172 warnings.filterwarnings('default', '', DeprecationWarning, 'hgext') 172 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext')
173 warnings.filterwarnings('default', '', DeprecationWarning, 'hgext3rd') 173 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext3rd')
174 174
175 def nouideprecwarn(msg, version, stacklevel=1): 175 def nouideprecwarn(msg, version, stacklevel=1):
176 """Issue an python native deprecation warning 176 """Issue an python native deprecation warning
177 177
178 This is a noop outside of tests, use 'ui.deprecwarn' when possible. 178 This is a noop outside of tests, use 'ui.deprecwarn' when possible.