From 060dcfd382a29eb642f7c5f65a925826a6e67b3a Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Mon, 25 Mar 2024 17:04:52 -0400 Subject: [PATCH] Small fixes for modern flake8. (#484) Signed-off-by: Chris Lalancette --- ament_copyright/ament_copyright/main.py | 2 +- ament_copyright/ament_copyright/parser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ament_copyright/ament_copyright/main.py b/ament_copyright/ament_copyright/main.py index 8e2a7b80..22194608 100644 --- a/ament_copyright/ament_copyright/main.py +++ b/ament_copyright/ament_copyright/main.py @@ -267,7 +267,7 @@ def add_missing_header(file_descriptors, name, license_, verbose): def add_copyright_year(file_descriptors, new_years, verbose): if verbose: - print(f'Adding {",".join(map(str,new_years))} to existing copyright notices:') + print(f'Adding {",".join(map(str, new_years))} to existing copyright notices:') print() for path in sorted(file_descriptors.keys()): diff --git a/ament_copyright/ament_copyright/parser.py b/ament_copyright/ament_copyright/parser.py index eb461ab0..c77a74b1 100644 --- a/ament_copyright/ament_copyright/parser.py +++ b/ament_copyright/ament_copyright/parser.py @@ -347,7 +347,7 @@ def remove_formatting(text): # Flat list of sections split on all separators provided def split_template(sections, separators): - if type(sections) != list: + if not isinstance(sections, list): return split_template([sections], separators) elif len(separators) > 1: return sum([split_template([section], separators[0:1]) for section