Rework extracting a block from the OOM

This commit is contained in:
Carsten Grohmann 2021-07-21 21:43:16 +02:00
parent db64b42393
commit c9b665b464

View File

@ -476,8 +476,7 @@ class OOMAnalyser(object):
def _extract_block_from_next_pos(self, marker): def _extract_block_from_next_pos(self, marker):
""" """
Extract a block starting with the marker and add all lines with a leading space character Extract a block that starts with the marker and contains all lines up to the next line with ":".
:rtype: str :rtype: str
""" """
block = '' block = ''
@ -487,7 +486,7 @@ class OOMAnalyser(object):
line = self.oom_entity.current() line = self.oom_entity.current()
block += "{}\n".format(line) block += "{}\n".format(line)
for line in self.oom_entity: for line in self.oom_entity:
if not line.startswith(' '): if ':' in line:
self.oom_entity.back() self.oom_entity.back()
break break
block += "{}\n".format(line) block += "{}\n".format(line)