def EnvArray():
"""Returns an env variable array from the os.environ map object."""
- return map(lambda k,v: k+"="+v, os.environ.keys(), os.environ.values())
+ return list(map(lambda k,v: k+"="+v, os.environ.keys(), os.environ.values()))
def line_number(filename, string_to_match):
"""Helper function to return the line number of the first matched string."""
return None
packed = struct.pack(fmt, val)
- return bytearray(map(ord, packed))
+ return bytearray(list(map(ord, packed)))
def bytearray_to_int(bytes, bytesize):
"""Utility function to convert a bytearray into an integer.
def GetFuncName(i):
return thread.GetFrameAtIndex(i).GetFunctionName()
- return map(GetFuncName, range(thread.GetNumFrames()))
+ return list(map(GetFuncName, range(thread.GetNumFrames())))
def get_symbol_names(thread):
def GetSymbol(i):
return thread.GetFrameAtIndex(i).GetSymbol().GetName()
- return map(GetSymbol, range(thread.GetNumFrames()))
+ return list(map(GetSymbol, range(thread.GetNumFrames())))
def get_pc_addresses(thread):
def GetPCAddress(i):
return thread.GetFrameAtIndex(i).GetPCAddress()
- return map(GetPCAddress, range(thread.GetNumFrames()))
+ return list(map(GetPCAddress, range(thread.GetNumFrames())))
def get_filenames(thread):
def GetFilename(i):
return thread.GetFrameAtIndex(i).GetLineEntry().GetFileSpec().GetFilename()
- return map(GetFilename, range(thread.GetNumFrames()))
+ return list(map(GetFilename, range(thread.GetNumFrames())))
def get_line_numbers(thread):
def GetLineNumber(i):
return thread.GetFrameAtIndex(i).GetLineEntry().GetLine()
- return map(GetLineNumber, range(thread.GetNumFrames()))
+ return list(map(GetLineNumber, range(thread.GetNumFrames())))
def get_module_names(thread):
def GetModuleName(i):
return thread.GetFrameAtIndex(i).GetModule().GetFileSpec().GetFilename()
- return map(GetModuleName, range(thread.GetNumFrames()))
+ return list(map(GetModuleName, range(thread.GetNumFrames())))
def get_stack_frames(thread):
def GetStackFrame(i):
return thread.GetFrameAtIndex(i)
- return map(GetStackFrame, range(thread.GetNumFrames()))
+ return list(map(GetStackFrame, range(thread.GetNumFrames())))
def print_stacktrace(thread, string_buffer = False):