Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions apport/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,13 +971,14 @@ def add_kernel_crash_info(self) -> bool:

This needs a VmCore in the Report.
"""
if "VmCore" not in self:
vm_core = self.get("VmCore")
if vm_core is None:
return False
with tempfile.NamedTemporaryFile(prefix="apport_vmcore_") as core:
if hasattr(self["VmCore"], "write"):
self["VmCore"].write(core)
if hasattr(vm_core, "write"):
vm_core.write(core)
else:
core.write(self["VmCore"])
core.write(vm_core)
core.flush()

kver = self["Uname"].split()[1]
Expand Down
Loading