From 5adfad0eb9470c3671e7d78a42a35d59b9ead026 Mon Sep 17 00:00:00 2001 From: Gustaf Blomqvist Date: Mon, 27 Jun 2022 17:33:53 +0200 Subject: [PATCH] Write XML ending to correct file when using --xml Previously when using --xml=FILE the beginning of the XML file would be written to FILE, while its ending would either (1) not be written at all (no -l/-L option), or (2) be written to RESULTS.xml in the directory specified using -l/-L. This patch ensures that the ending of the XML file is always written to the correct file. --- patator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patator.py b/patator.py index 02e653e..0f06c73 100755 --- a/patator.py +++ b/patator.py @@ -899,8 +899,8 @@ def process_logs(queue, indicatorsfmt, argv, log_dir, runtime_file, csv_file, xm pname, action, args = queue.get() if action == 'quit': - if log_dir: - with open(os.path.join(log_dir, 'RESULTS.xml'), 'a') as f: + if xml_file or log_dir: + with open(results_xml, 'a') as f: f.write('\n\n\n' % (xmlquoteattr(strfutctime()), xmlquoteattr(strflocaltime()))) break