mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
🎨
This commit is contained in:
parent
995ef743ec
commit
bf728499be
|
@ -78,8 +78,8 @@ def deprecated(reason, replacement, gone_in, issue=None):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Construct a nice message.
|
# Construct a nice message.
|
||||||
# This is purposely eagerly formatted as we want it to appear as if someone
|
# This is eagerly formatted as we want it to get logged as if someone
|
||||||
# typed this entire message out.
|
# typed this entire message out.
|
||||||
message = DEPRECATION_MSG_PREFIX + reason
|
message = DEPRECATION_MSG_PREFIX + reason
|
||||||
|
|
||||||
if gone_in is not None:
|
if gone_in is not None:
|
||||||
|
@ -95,4 +95,5 @@ def deprecated(reason, replacement, gone_in, issue=None):
|
||||||
# Raise as an error if it has to be removed.
|
# Raise as an error if it has to be removed.
|
||||||
if gone_in is not None and parse(current_version) >= parse(gone_in):
|
if gone_in is not None and parse(current_version) >= parse(gone_in):
|
||||||
raise PipDeprecationWarning(message)
|
raise PipDeprecationWarning(message)
|
||||||
|
|
||||||
warnings.warn(message, category=PipDeprecationWarning, stacklevel=2)
|
warnings.warn(message, category=PipDeprecationWarning, stacklevel=2)
|
||||||
|
|
Loading…
Reference in a new issue