# Gather all the dirs passed on the command line.
if len(args.args) > 0:
- configuration.testdirs = list(
- map(lambda x: os.path.realpath(os.path.abspath(x)), args.args))
+ configuration.testdirs = [os.path.realpath(os.path.abspath(x)) for x in args.args]
# Shut off multiprocessing mode when test directories are specified.
configuration.no_multiprocess_test_runner = True
for (base, dirs, files) in os.walk(inc_dir):
dir = os.path.basename(base)
relative = os.path.relpath(base, inc_dir)
- inc_files = filter(lambda x : os.path.splitext(x)[1] in [".h"], files)
+ inc_files = [x for x in files if os.path.splitext(x)[1] in [".h"]]
relative = relative.replace("\\", "/")
for inc in inc_files:
inc_path = os.path.join(base, inc)
for (base, dirs, files) in os.walk(src_dir):
dir = os.path.basename(base)
relative = os.path.relpath(base, src_dir)
- src_files = filter(lambda x : os.path.splitext(x)[1] in [".cpp", ".h", ".mm"], files)
+ src_files = [x for x in files if os.path.splitext(x)[1] in [".cpp", ".h", ".mm"]]
norm_base_path = os.path.normpath(os.path.join("lldb", relative))
norm_base_path = norm_base_path.replace("\\", "/")
for src in src_files:
full_path = os.path.normpath(os.path.join(src_root, subfolder))
candidates = [os.path.normpath(os.path.join(full_path, f))
for f in os.listdir(full_path)]
- actual = filter(
- lambda f: os.path.isfile(f) and os.path.splitext(f)[1] == ext,
- candidates)
- return (subfolder, map(lambda f: os.path.basename(f), actual))
+ actual = [f for f in candidates if os.path.isfile(f) and os.path.splitext(f)[1] == ext]
+ return (subfolder, [os.path.basename(f) for f in actual])
archive_entries = map(filter_func, filters)
else:
for (root, dirs, files) in os.walk(src_root):
return None
packed = struct.pack(fmt, val)
- return bytearray(map(ord, packed))
+ return bytearray(ord(x) for x in packed)
def bytearray_to_int(bytes, bytesize):
def GetFuncName(i):
return thread.GetFrameAtIndex(i).GetFunctionName()
- return map(GetFuncName, range(thread.GetNumFrames()))
+ return [GetFuncName(i) for i in range(thread.GetNumFrames())]
def get_symbol_names(thread):
def GetSymbol(i):
return thread.GetFrameAtIndex(i).GetSymbol().GetName()
- return map(GetSymbol, range(thread.GetNumFrames()))
+ return [GetSymbol(i) for i in range(thread.GetNumFrames())]
def get_pc_addresses(thread):
def GetPCAddress(i):
return thread.GetFrameAtIndex(i).GetPCAddress()
- return map(GetPCAddress, range(thread.GetNumFrames()))
+ return [GetPCAddress(i) for i in range(thread.GetNumFrames())]
def get_filenames(thread):
return thread.GetFrameAtIndex(
i).GetLineEntry().GetFileSpec().GetFilename()
- return map(GetFilename, range(thread.GetNumFrames()))
+ return [GetFilename(i) for i in range(thread.GetNumFrames())]
def get_line_numbers(thread):
def GetLineNumber(i):
return thread.GetFrameAtIndex(i).GetLineEntry().GetLine()
- return map(GetLineNumber, range(thread.GetNumFrames()))
+ return [GetLineNumber(i) for i in range(thread.GetNumFrames())]
def get_module_names(thread):
return thread.GetFrameAtIndex(
i).GetModule().GetFileSpec().GetFilename()
- return map(GetModuleName, range(thread.GetNumFrames()))
+ return [GetModuleName(i) for i in range(thread.GetNumFrames())]
def get_stack_frames(thread):
def GetStackFrame(i):
return thread.GetFrameAtIndex(i)
- return map(GetStackFrame, range(thread.GetNumFrames()))
+ return [GetStackFrame(i) for i in range(thread.GetNumFrames())]
def print_stacktrace(thread, string_buffer=False):
pass
if result.GetSize() > 0:
- results = filter(None, [result.GetStringAtIndex(x)
- for x in range(result.GetSize())])
+ results = [_f for _f in [result.GetStringAtIndex(x)
+ for x in range(result.GetSize())] if _f]
return results
else:
return []