From eb400f19b1aed614124583c708d7fa22b8d0b8b9 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 18 Jun 2024 03:36:16 -0700 Subject: [PATCH] Support Python 3.12+ --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 55167795d..6d6fc3efe 100755 --- a/build.py +++ b/build.py @@ -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)