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
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:
# 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):
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
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())
))
)
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: