From 7969bb7e420c18e209ec81f077f922d0bac6f20d Mon Sep 17 00:00:00 2001 From: Florian Pommerening Date: Thu, 25 Jul 2024 19:12:15 +0200 Subject: [PATCH] undo change in PlanManager --- driver/plan_manager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/driver/plan_manager.py b/driver/plan_manager.py index eef66bac54..58937eacab 100644 --- a/driver/plan_manager.py +++ b/driver/plan_manager.py @@ -5,13 +5,15 @@ from . import returncodes -_PLAN_INFO_REGEX = re.compile(r"; cost = (\d+) \((unit cost|general cost)\)") +_PLAN_INFO_REGEX = re.compile(r"; cost = (\d+) \((unit cost|general cost)\)\n") def _read_last_line(path: Path): - lines = path.read_text().splitlines() - if lines: - return lines[-1] + line = None + with path.open() as input_file: + for line in input_file: + pass + return line def _parse_plan(plan_path: Path):