Skip to content

Commit 24a4e6a

Browse files
authored
_std: show caller source in deprecation message (#228)
Closes #227
1 parent 962ad13 commit 24a4e6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

py/_std.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ def __init__(self):
1515
self.__dict__ = sys.modules
1616

1717
def __getattr__(self, name):
18-
warnings.warn("py.std is deprecated, plase import %s directly" % name,
19-
category=PyStdIsDeprecatedWarning)
18+
warnings.warn("py.std is deprecated, please import %s directly" % name,
19+
category=PyStdIsDeprecatedWarning,
20+
stacklevel=2)
2021
try:
2122
m = __import__(name)
2223
except ImportError:

0 commit comments

Comments
 (0)