diff options
author | Fangrui Song <i@maskray.me> | 2023-05-11 23:06:01 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-05-11 23:06:02 -0700 |
commit | aa6cb0f21461d76d296c7c6139d0a8e355238ce5 (patch) | |
tree | b7561f8f4d86377b8c4169206f2303b818a04718 /compiler-rt | |
parent | 2394f091df0bba3f8c5362df1f7b6502cc837f66 (diff) | |
download | llvm-aa6cb0f21461d76d296c7c6139d0a8e355238ce5.tar.gz |
[test] Remove Python<3.3 workaround without shlex.quote
Python>=3.6 has been the requirement since D93097 (2020).
Remove old workarounds.
Remove unused imports from compiler-rt/test/memprof/lit.cfg.py
Reviewed By: serge-sans-paille
Differential Revision: https://reviews.llvm.org/D150410
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/test/asan/lit.cfg.py | 12 | ||||
-rw-r--r-- | compiler-rt/test/lit.common.cfg.py | 18 | ||||
-rw-r--r-- | compiler-rt/test/memprof/lit.cfg.py | 9 |
3 files changed, 7 insertions, 32 deletions
diff --git a/compiler-rt/test/asan/lit.cfg.py b/compiler-rt/test/asan/lit.cfg.py index e8c96f9b58d0..9a8e513521a3 100644 --- a/compiler-rt/test/asan/lit.cfg.py +++ b/compiler-rt/test/asan/lit.cfg.py @@ -3,18 +3,10 @@ import os import platform import re +import shlex import lit.formats -# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if -# it's not available. -try: - import shlex - sh_quote = shlex.quote -except: - import pipes - sh_quote = pipes.quote - def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: @@ -182,7 +174,7 @@ if platform.system() == 'Windows': # FIXME: De-hardcode this path. asan_source_dir = os.path.join( get_required_attr(config, "compiler_rt_src_root"), "lib", "asan") -python_exec = sh_quote(get_required_attr(config, "python_executable")) +python_exec = shlex.quote(get_required_attr(config, "python_executable")) # Setup path to asan_symbolize.py script. asan_symbolize = os.path.join(asan_source_dir, "scripts", "asan_symbolize.py") if not os.path.exists(asan_symbolize): diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index 0608b08f09de..432f73889584 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -6,21 +6,13 @@ import os import platform import re +import shlex import subprocess import json import lit.formats import lit.util -# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if -# it's not available. -try: - import shlex - sh_quote = shlex.quote -except: - import pipes - sh_quote = pipes.quote - def find_compiler_libdir(): """ Returns the path to library resource directory used @@ -730,15 +722,15 @@ if config.host_os == 'Darwin': config.substitutions.append(( "%get_pid_from_output", "{} {}/get_pid_from_output.py".format( - sh_quote(config.python_executable), - sh_quote(get_ios_commands_dir()) + shlex.quote(config.python_executable), + shlex.quote(get_ios_commands_dir()) )) ) config.substitutions.append( ("%print_crashreport_for_pid", "{} {}/print_crashreport_for_pid.py".format( - sh_quote(config.python_executable), - sh_quote(get_ios_commands_dir()) + shlex.quote(config.python_executable), + shlex.quote(get_ios_commands_dir()) )) ) diff --git a/compiler-rt/test/memprof/lit.cfg.py b/compiler-rt/test/memprof/lit.cfg.py index e472101b1f16..80a325a38e40 100644 --- a/compiler-rt/test/memprof/lit.cfg.py +++ b/compiler-rt/test/memprof/lit.cfg.py @@ -6,15 +6,6 @@ import re import lit.formats -# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if -# it's not available. -try: - import shlex - sh_quote = shlex.quote -except: - import pipes - sh_quote = pipes.quote - def get_required_attr(config, attr_name): attr_value = getattr(config, attr_name, None) if attr_value == None: |