Restore old warnings.formatwarning after workaround

See https://github.com/saltstack/salt/pull/17298#issuecomment-62364647
This commit is contained in:
Erik Johnson 2014-11-10 13:49:13 -06:00
parent 1fd9983fc7
commit ee306e18b7

View File

@ -1880,12 +1880,14 @@ def warn_until(version,
return '{0}:{1}: {2}: {3}'.format(
filename, lineno, category.__name__, message
)
saved = warnings.formatwarning
warnings.formatwarning = _formatwarning
warnings.warn(
message.format(version=version.formatted_version),
category,
stacklevel=stacklevel
)
warnings.formatwarning = saved
def kwargs_warn_until(kwargs,