summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.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/tarfile.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/tarfile.py')
-rwxr-xr-xLib/tarfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 726f9f5..ec32f9b 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -46,7 +46,6 @@ import time
import struct
import copy
import re
-import warnings
try:
import pwd
@@ -2219,6 +2218,7 @@ class TarFile(object):
if filter is None:
filter = self.extraction_filter
if filter is None:
+ import warnings
warnings.warn(
'Python 3.14 will, by default, filter extracted tar '
+ 'archives and reject files or modify their metadata. '