comparison mercurial/util.py @ 36128:02ed94dd9fd6

util: call warnings.warn() with a sysstr in nouideprecwarn This preserves nouideprecwarn wanting a bytes, which is consistent with the rest of hg. Differential Revision: https://phab.mercurial-scm.org/D2210
author Augie Fackler <augie@google.com>
date Mon, 12 Feb 2018 20:43:05 -0500
parents 15c8c4ac5d9c
children 2874896a6e3b
comparison
equal deleted inserted replaced
36127:df1760b58fda 36128:02ed94dd9fd6
251 This is a noop outside of tests, use 'ui.deprecwarn' when possible. 251 This is a noop outside of tests, use 'ui.deprecwarn' when possible.
252 """ 252 """
253 if _dowarn: 253 if _dowarn:
254 msg += ("\n(compatibility will be dropped after Mercurial-%s," 254 msg += ("\n(compatibility will be dropped after Mercurial-%s,"
255 " update your code.)") % version 255 " update your code.)") % version
256 warnings.warn(msg, DeprecationWarning, stacklevel + 1) 256 warnings.warn(pycompat.sysstr(msg), DeprecationWarning, stacklevel + 1)
257 257
258 DIGESTS = { 258 DIGESTS = {
259 'md5': hashlib.md5, 259 'md5': hashlib.md5,
260 'sha1': hashlib.sha1, 260 'sha1': hashlib.sha1,
261 'sha512': hashlib.sha512, 261 'sha512': hashlib.sha512,