mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Add "DEPRECATION" to start of message when composing it
This commit is contained in:
parent
a1912454b8
commit
4c2b268d52
1 changed files with 3 additions and 6 deletions
|
@ -35,11 +35,6 @@ def _showwarning(message, category, filename, lineno, file=None, line=None):
|
|||
# deprecation messages for pip.
|
||||
logger = logging.getLogger("pip._internal.deprecations")
|
||||
|
||||
# This is purposely using the % formatter here instead of letting
|
||||
# the logging module handle the interpolation. This is because we
|
||||
# want it to appear as if someone typed this entire message out.
|
||||
log_message = "DEPRECATION: %s" % message
|
||||
|
||||
# PipPendingDeprecationWarnings still have at least 2
|
||||
# versions to go until they are removed so they can just be
|
||||
# warnings. Otherwise, they will be removed in the very next
|
||||
|
@ -74,7 +69,9 @@ def deprecated(reason, replacement, issue=None, imminent=False):
|
|||
category = PipPendingDeprecationWarning
|
||||
|
||||
# Construct a nice message.
|
||||
message = reason
|
||||
# This is purposely eagerly formatted as we want it to appear as if someone
|
||||
# typed this entire message out.
|
||||
message = "DEPRECATION: " + reason
|
||||
if replacement is not None:
|
||||
message += " An alternative is to {}.".format(replacement)
|
||||
if issue is not None:
|
||||
|
|
Loading…
Reference in a new issue