Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def toCrash(self, getMemoryDump = False):
"""
Returns a L{Crash} object using the data retrieved from the database.
@type getMemoryDump: bool
@param getMemoryDump: If C{True} retrieve the memory dump.
Defaults to C{False} since this may be a costly operation.
@rtype: L{Crash}
@return: Crash object.
"""
crash = Marshaller.loads(str(self.data))
if not isinstance(crash, Crash):
raise TypeError(
"Expected Crash instance, got %s instead" % type(crash))
crash._rowid = self.id
if not crash.memoryMap:
memory = getattr(self, "memory", [])
if memory:
crash.memoryMap = [dto.toMBI(getMemoryDump) for dto in memory]
return crash
def toCrash(self, getMemoryDump = False):
"""
Returns a L{Crash} object using the data retrieved from the database.
@type getMemoryDump: bool
@param getMemoryDump: If C{True} retrieve the memory dump.
Defaults to C{False} since this may be a costly operation.
@rtype: L{Crash}
@return: Crash object.
"""
crash = Marshaller.loads(str(self.data))
if not isinstance(crash, Crash):
raise TypeError(
"Expected Crash instance, got %s instead" % type(crash))
crash._rowid = self.id
if not crash.memoryMap:
memory = getattr(self, "memory", [])
if memory:
crash.memoryMap = [dto.toMBI(getMemoryDump) for dto in memory]
return crash