mirror of
https://github.com/python/cpython.git
synced 2025-10-05 14:41:07 +00:00
Allow developers to not have to either test on N Python versions or
looked through multiple versions of the docs to know whether they can
easily update.
(cherry picked from commit c643a967dd
)
This commit is contained in:
parent
0ad7b628ed
commit
d0620bcd4e
3 changed files with 25 additions and 6 deletions
|
@ -542,7 +542,8 @@ def encodebytes(s):
|
|||
def encodestring(s):
|
||||
"""Legacy alias of encodebytes()."""
|
||||
import warnings
|
||||
warnings.warn("encodestring() is a deprecated alias, use encodebytes()",
|
||||
warnings.warn("encodestring() is a deprecated alias since 3.1, "
|
||||
"use encodebytes()",
|
||||
DeprecationWarning, 2)
|
||||
return encodebytes(s)
|
||||
|
||||
|
@ -555,7 +556,8 @@ def decodebytes(s):
|
|||
def decodestring(s):
|
||||
"""Legacy alias of decodebytes()."""
|
||||
import warnings
|
||||
warnings.warn("decodestring() is a deprecated alias, use decodebytes()",
|
||||
warnings.warn("decodestring() is a deprecated alias since Python 3.1, "
|
||||
"use decodebytes()",
|
||||
DeprecationWarning, 2)
|
||||
return decodebytes(s)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue