From c74a9fdf60ab4c149ad4bedbbb35a75d0cec1793 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Wed, 11 Sep 2024 08:31:52 -0400 Subject: [PATCH] CI: Resolve flake8 issues in utils directory (#4303) * resolved flake8 in utils * updated .flake8 --------- Co-authored-by: Arohan Ajit --- .flake8 | 1 - utils/gitlog2changelog.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index 8a4bf960bf5..32021622d7d 100644 --- a/.flake8 +++ b/.flake8 @@ -21,7 +21,6 @@ per-file-ignores = # E741 ambiguous variable name 'l' __init__.py: F401, F403 lib/init/grass.py: E722, F821, F841 - utils/gitlog2changelog.py: E722, E712 man/build_check_rest.py: F403, F405 man/build_full_index_rest.py: F403, F405 man/parser_standard_options.py: F403, F405 diff --git a/utils/gitlog2changelog.py b/utils/gitlog2changelog.py index 2626321d6fb..758b142196b 100755 --- a/utils/gitlog2changelog.py +++ b/utils/gitlog2changelog.py @@ -66,8 +66,8 @@ author = authorList[1] author = author[0 : len(author) - 1] authorFound = True - except: - print("Could not parse authorList = '%s'" % (line)) + except Exception as e: + print(f"Could not parse authorList = '{line}'. Error: {e!s}") # Match the date line elif line.startswith("Date:"): @@ -76,8 +76,8 @@ date = dateList[1] date = date[0 : len(date) - 1] dateFound = True - except: - print("Could not parse dateList = '%s'" % (line)) + except Exception as e: + print(f"Could not parse dateList = '{line}'. Error: {e!s}") # The Fossil-IDs are ignored: elif line.startswith(" Fossil-ID:") or line.startswith(" [[SVN:"): continue