aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.com>2024-09-09 04:49:37 +0300
committersnermolaev <snermolaev@yandex-team.com>2024-09-09 04:58:08 +0300
commit2cb42f4e81ff61b9724890830d657cdacab91eec (patch)
tree6bf629bccb09b8025ac2040963904628570947f6 /build
parentc008a8208b6b86684b208b98fbffb96567cd9885 (diff)
downloadydb-2cb42f4e81ff61b9724890830d657cdacab91eec.tar.gz
fix DeprecationWarning
dafdaedfdc8d7dd4c6681da5b98a59940c63f548
Diffstat (limited to 'build')
-rw-r--r--build/scripts/compile_pysrc.py6
-rw-r--r--build/scripts/extract_asrc.py7
-rw-r--r--build/scripts/gen_aar_gradle_script.py6
-rw-r--r--build/scripts/go_tool.py5
-rw-r--r--build/scripts/link_asrc.py11
5 files changed, 29 insertions, 6 deletions
diff --git a/build/scripts/compile_pysrc.py b/build/scripts/compile_pysrc.py
index e3637e18e2..e75f298451 100644
--- a/build/scripts/compile_pysrc.py
+++ b/build/scripts/compile_pysrc.py
@@ -2,6 +2,7 @@ import argparse
import os
import shutil
import subprocess
+import sys
import tarfile
@@ -55,7 +56,10 @@ def main():
names = []
with tarfile.open(args.input, 'r') as tar:
names = tar.getnames()
- tar.extractall()
+ if sys.version_info >= (3, 12):
+ tar.extractall(filter='data')
+ else:
+ tar.extractall()
if args.mode == 'py3':
pycc_cmd = [args.pycc]
diff --git a/build/scripts/extract_asrc.py b/build/scripts/extract_asrc.py
index b413fab09e..9b9c740066 100644
--- a/build/scripts/extract_asrc.py
+++ b/build/scripts/extract_asrc.py
@@ -1,5 +1,6 @@
import argparse
import os
+import sys
import tarfile
@@ -16,7 +17,11 @@ def main():
for asrc in [x for x in args.input if x.endswith('.asrc') and os.path.exists(x)]:
with tarfile.open(asrc, 'r') as tar:
- tar.extractall(path=args.output)
+ if sys.version_info >= (3, 12):
+ tar.extractall(path=args.output, filter='data')
+ else:
+ tar.extractall(path=args.output)
+
if __name__ == '__main__':
diff --git a/build/scripts/gen_aar_gradle_script.py b/build/scripts/gen_aar_gradle_script.py
index edb38861a3..0dd8dc226f 100644
--- a/build/scripts/gen_aar_gradle_script.py
+++ b/build/scripts/gen_aar_gradle_script.py
@@ -1,5 +1,6 @@
import argparse
import os
+import sys
import tarfile
FLAT_DIRS_REPO_TEMPLATE = 'flatDir {{ dirs {dirs} }}\n'
@@ -269,7 +270,10 @@ if __name__ == '__main__':
jsrc_dir = os.path.join(args.output_dir, 'jsrc_{}'.format(str(index)))
os.makedirs(jsrc_dir)
with tarfile.open(jsrc, 'r') as tar:
- tar.extractall(path=jsrc_dir)
+ if sys.version_info >= (3, 12):
+ tar.extractall(path=jsrc_dir, filter='data')
+ else:
+ tar.extractall(path=jsrc_dir)
args.java_dirs.append(jsrc_dir)
args.build_gradle = os.path.join(args.output_dir, 'build.gradle')
diff --git a/build/scripts/go_tool.py b/build/scripts/go_tool.py
index f11b3b82df..39d55df4d3 100644
--- a/build/scripts/go_tool.py
+++ b/build/scripts/go_tool.py
@@ -83,7 +83,10 @@ def preprocess_args(args):
if f.endswith('.gosrc'):
with tarfile.open(f, 'r') as tar:
srcs.extend(os.path.join(args.output_root, src) for src in tar.getnames())
- tar.extractall(path=args.output_root)
+ if sys.version_info >= (3, 12):
+ tar.extractall(path=args.output_root, filter='data')
+ else:
+ tar.extractall(path=args.output_root)
else:
srcs.append(f)
args.srcs = srcs
diff --git a/build/scripts/link_asrc.py b/build/scripts/link_asrc.py
index ec8d92c74d..42b7ef0641 100644
--- a/build/scripts/link_asrc.py
+++ b/build/scripts/link_asrc.py
@@ -1,6 +1,7 @@
import argparse
import itertools
import os
+import sys
import tarfile
@@ -61,13 +62,19 @@ def main():
if names and len(names) > 0:
parts.append([DELIM_JAVA, src_dir])
parts[-1].extend(itertools.imap(lambda x: os.path.join(src_dir, x), names))
- tar.extractall(path=src_dir)
+ if sys.version_info >= (3, 12):
+ tar.extractall(path=src_dir, filter='data')
+ else:
+ tar.extractall(path=src_dir)
if args.asrcs and len(args.asrcs):
for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.asrcs):
with tarfile.open(asrc, 'r') as tar:
files.extend(tar.getnames())
- tar.extractall(path=args.work)
+ if sys.version_info >= (3, 12):
+ tar.extractall(path=args.work, filter='data')
+ else:
+ tar.extractall(path=args.work)
with tarfile.open(args.output, 'w') as out:
for part in parts: