mirror of
https://github.com/python/cpython.git
synced 2025-10-07 23:51:16 +00:00
gh-109653: Defer importing warnings
in several modules (#110286)
This commit is contained in:
parent
f02f26e293
commit
bfe7e72522
6 changed files with 10 additions and 6 deletions
|
@ -10,7 +10,6 @@ import stat
|
|||
import fnmatch
|
||||
import collections
|
||||
import errno
|
||||
import warnings
|
||||
|
||||
try:
|
||||
import zlib
|
||||
|
@ -723,6 +722,7 @@ def rmtree(path, ignore_errors=False, onerror=None, *, onexc=None, dir_fd=None):
|
|||
"""
|
||||
|
||||
if onerror is not None:
|
||||
import warnings
|
||||
warnings.warn("onerror argument is deprecated, use onexc instead",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue