mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
#4351: more appropriate DeprecationWarning stacklevels
This commit is contained in:
parent
6f9977852f
commit
d846f1d4c2
9 changed files with 22 additions and 16 deletions
|
@ -216,7 +216,8 @@ def walk(top, func, arg):
|
|||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue