mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
#4351: more appropriate DeprecationWarning stacklevels
This commit is contained in:
parent
e7d149ecf0
commit
a394f2dca3
4 changed files with 9 additions and 9 deletions
|
@ -51,7 +51,7 @@ def maketrans(frm: bytes, to: bytes) -> bytes:
|
|||
"""
|
||||
import warnings
|
||||
warnings.warn("string.maketrans is deprecated, use bytes.maketrans instead",
|
||||
DeprecationWarning)
|
||||
DeprecationWarning, 2)
|
||||
if len(frm) != len(to):
|
||||
raise ValueError("maketrans arguments must have same length")
|
||||
if not (isinstance(frm, bytes) and isinstance(to, bytes)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue