Support Python 3.12+

This commit is contained in:
topjohnwu 2024-06-18 03:36:16 -07:00
parent 19f15f16f6
commit eb400f19b1

View File

@ -536,7 +536,10 @@ def setup_ndk(args):
rm_rf(ondk_path)
with urllib.request.urlopen(url) as response:
with tarfile.open(mode="r|xz", fileobj=response) as tar:
tar.extractall(ndk_root)
if hasattr(tarfile, "data_filter"):
tar.extractall(ndk_root, filter="tar")
else:
tar.extractall(ndk_root)
rm_rf(ndk_path)
mv(ondk_path, ndk_path)