1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
This commit is contained in:
Pradyun Gedam 2019-05-25 21:56:20 -04:00
parent 995ef743ec
commit bf728499be
No known key found for this signature in database
GPG key ID: DA17C4B29CB32E4B

View file

@ -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)