#4351: more appropriate DeprecationWarning stacklevels

This commit is contained in:
Philip Jenvey 2009-05-08 03:57:12 +00:00
parent e7d149ecf0
commit a394f2dca3
4 changed files with 9 additions and 9 deletions

View file

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