Skip to content

Commit 44c4b4f

Browse files
encukoumcepl
authored andcommitted
Downgrade to Python 3.6
1 parent 4d80f04 commit 44c4b4f

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

Lib/shutil.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,8 @@ def unpack_archive(filename, extract_dir=None, format=None, *, filter=None):
988988
raise ReadError("Unknown archive format '{0}'".format(filename))
989989

990990
func = _UNPACK_FORMATS[format][1]
991-
kwargs = dict(_UNPACK_FORMATS[format][2]) | filter_kwargs
991+
kwargs = dict(_UNPACK_FORMATS[format][2])
992+
kwargs.update(filter_kwargs)
992993
func(filename, extract_dir, **kwargs)
993994

994995

Lib/test/test_shutil.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
from test import support
2828
from test.support import TESTFN, FakePath
29-
from test.support import warnings_helper
3029

3130
TESTFN2 = TESTFN + "2"
3231

@@ -1270,7 +1269,7 @@ def check_unpack_archive_with_converter(self, format, converter, **kwargs):
12701269
def check_unpack_tarball(self, format):
12711270
self.check_unpack_archive(format, filter='fully_trusted')
12721271
self.check_unpack_archive(format, filter='data')
1273-
with warnings_helper.check_warnings(
1272+
with support.check_warnings(
12741273
('The default', RuntimeWarning)):
12751274
self.check_unpack_archive(format)
12761275

Lib/test/test_tarfile.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from test import support
1818
from test.support import script_helper
19-
from test.support import warnings_helper
2019

2120
# Check for our compression modules.
2221
try:
@@ -2711,8 +2710,7 @@ def setUpClass(cls):
27112710
tar.errorlevel = 0
27122711
with ExitStack() as cm:
27132712
if cls.extraction_filter is None:
2714-
cm.enter_context(warnings.catch_warnings(
2715-
action="ignore", category=DeprecationWarning))
2713+
cm.enter_context(warnings.catch_warnings())
27162714
tar.extractall(cls.control_dir, filter=cls.extraction_filter)
27172715
tar.close()
27182716
cls.control_paths = set(
@@ -2842,8 +2840,8 @@ def test_list(self):
28422840
for attr_names in ({'mtime'}, {'mode'}, {'uid'}, {'gid'},
28432841
{'uname'}, {'gname'},
28442842
{'uid', 'uname'}, {'gid', 'gname'}):
2845-
with (self.subTest(attr_names=attr_names),
2846-
tarfile.open(tarname, encoding="iso8859-1") as tar):
2843+
with self.subTest(attr_names=attr_names), \
2844+
tarfile.open(tarname, encoding="iso8859-1") as tar:
28472845
tio_prev = io.TextIOWrapper(io.BytesIO(), 'ascii', newline='\n')
28482846
with support.swap_attr(sys, 'stdout', tio_prev):
28492847
tar.list()
@@ -3034,7 +3032,7 @@ def expect_file(self, name, type=None, symlink_to=None, mode=None):
30343032
if type is None and isinstance(name, str) and name.endswith('/'):
30353033
type = tarfile.DIRTYPE
30363034
if symlink_to is not None:
3037-
got = (self.destdir / name).readlink()
3035+
got = pathlib.Path(os.readlink(self.destdir / name))
30383036
expected = pathlib.Path(symlink_to)
30393037
# The symlink might be the same (textually) as what we expect,
30403038
# but some systems change the link to an equivalent path, so
@@ -3351,7 +3349,7 @@ def test_default_filter_warns(self):
33513349
"""Ensure the default filter warns"""
33523350
with ArchiveMaker() as arc:
33533351
arc.add('foo')
3354-
with warnings_helper.check_warnings(
3352+
with support.check_warnings(
33553353
('Python 3.14', DeprecationWarning)):
33563354
with self.check_context(arc.open(), None):
33573355
self.expect_file('foo')

0 commit comments

Comments
 (0)