gh-109653: Defer importing warnings in several modules (#110286)

This commit is contained in:
Alex Waygood 2023-10-04 06:09:43 +01:00 committed by GitHub
parent f02f26e293
commit bfe7e72522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 6 deletions

View file

@ -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. '