summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-10-04 05:09:43 (GMT)
committerGitHub <noreply@github.com>2023-10-04 05:09:43 (GMT)
commitbfe7e72522565f828f43c2591fea84a7981ee048 (patch)
treec1602e78494734ac325d395f51a74fe55bb8d5c7 /Lib/shutil.py
parentf02f26e29366513b097578fbc6b25e02d0eba7c0 (diff)
downloadcpython-bfe7e72522565f828f43c2591fea84a7981ee048.zip
cpython-bfe7e72522565f828f43c2591fea84a7981ee048.tar.gz
cpython-bfe7e72522565f828f43c2591fea84a7981ee048.tar.bz2
gh-109653: Defer importing `warnings` in several modules (#110286)
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index a278b74..0fed011 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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)