diff --git a/scripts/download-clang-prebuilt-binaries.py b/scripts/download-clang-prebuilt-binaries.py index c8b81e707..e7bc9ea7b 100755 --- a/scripts/download-clang-prebuilt-binaries.py +++ b/scripts/download-clang-prebuilt-binaries.py @@ -37,7 +37,10 @@ def download_url(url, tarball): def extract_tarfile(tar): print('Extracting %s' % tar) with tarfile.open(tar) as package_tar: - package_tar.extractall() + if sys.version_info >= (3, 12): + package_tar.extractall(filter='tar') + else: + package_tar.extractall() def mkdir_p(path): try: diff --git a/scripts/install-sysroot-freebsd.py b/scripts/install-sysroot-freebsd.py index 7afcb05dd..c2e1bf4da 100755 --- a/scripts/install-sysroot-freebsd.py +++ b/scripts/install-sysroot-freebsd.py @@ -71,7 +71,10 @@ def extract_tarfile(tar, sysroot=".", filters=[]): filtered_members.append(member) if not filtered_members: return - package_tar.extractall(sysroot, filtered_members) + if sys.version_info >= (3, 12): + package_tar.extractall(sysroot, filtered_members, filter='tar') + else: + package_tar.extractall(sysroot, filtered_members) def GetSha256(filename): diff --git a/scripts/install-sysroot.py b/scripts/install-sysroot.py index 97669f2f9..37775761f 100755 --- a/scripts/install-sysroot.py +++ b/scripts/install-sysroot.py @@ -59,7 +59,10 @@ def GetSha1(filename): def extract_tarfile(tar, sysroot): print('Extracting %s' % tar) with tarfile.open(tar) as package_tar: - package_tar.extractall(sysroot) + if sys.version_info >= (3, 12): + package_tar.extractall(sysroot, filter='tar') + else: + package_tar.extractall(sysroot) def main(args): parser = optparse.OptionParser('usage: %prog [OPTIONS]', description=__doc__) parser.add_option('--arch',