#4351: more appropriate DeprecationWarning stacklevels
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 0ec430d..15be83c 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -216,7 +216,8 @@
beyond that arg is always passed to func. It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics. Passing None for arg is common."""
- warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.")
+ warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.",
+ stacklevel=2)
try:
names = os.listdir(top)
except os.error: