From 749d1aad3e4568c1dfb90837434ef378a39a4bdf Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 24 Aug 2022 07:17:37 +0000 Subject: [PATCH] eddn-report: `str.startswith()` doesn't do regex I brainfarted, slinging a `.+` into this to generalise it, when the code is using `str.startswith()`, not a regex match. So, use two tests, `.startswith()` for the static portion, then a `.find()` for the remainder after the variant part. --- scripts/eddn-report-log-errors | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/eddn-report-log-errors b/scripts/eddn-report-log-errors index bf652d1..59c17b0 100755 --- a/scripts/eddn-report-log-errors +++ b/scripts/eddn-report-log-errors @@ -77,8 +77,10 @@ def process_file(input_file: str) -> None: # https://github.com/EDDiscovery/EDDiscovery/releases/latest if software_version >= semantic_version.Version.coerce('15.1.1.0'): if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/outfitting/2': - if matches.group('err_msg').startswith( - 'Failed Validation "[]' + err_msg = matches.group('err_msg') + if ( + err_msg.startswith('Failed Validation "[]') != -1 ): # pass