From d8db6017bacc5cc6f7d3974a5dff9352157f41d4 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Sat, 2 Dec 2023 06:59:32 +0000 Subject: [PATCH] rpl_regex: remove args from functions as this was rightfully marked by updated bugbear, that in before we were mixing named and positioned arguments. Remove *args, as it also not supported by regex functions Signed-off-by: Konrad Weihmann --- oelint_parser/rpl_regex.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/oelint_parser/rpl_regex.py b/oelint_parser/rpl_regex.py index a2202c8..e94aa3c 100644 --- a/oelint_parser/rpl_regex.py +++ b/oelint_parser/rpl_regex.py @@ -6,7 +6,7 @@ class RegexRpl(): """ @staticmethod - def search(pattern, string, timeout=5, default=None, *args, **kwargs): + def search(pattern, string, timeout=5, default=None, **kwargs): """replacement for re.search Args: @@ -19,12 +19,12 @@ def search(pattern, string, timeout=5, default=None, *args, **kwargs): Match: Match object or None """ try: - return regex.search(pattern, string, timeout=timeout, *args, **kwargs) + return regex.search(pattern, string, timeout=timeout, **kwargs) except TimeoutError: return default @staticmethod - def split(pattern, string, timeout=5, default=None, *args, **kwargs): + def split(pattern, string, timeout=5, default=None, **kwargs): """replacement for re.split Args: @@ -37,12 +37,12 @@ def split(pattern, string, timeout=5, default=None, *args, **kwargs): list: list object or None """ try: - return regex.split(pattern, string, timeout=timeout, *args, **kwargs) + return regex.split(pattern, string, timeout=timeout, **kwargs) except TimeoutError: return default @staticmethod - def match(pattern, string, timeout=5, default=None, *args, **kwargs): + def match(pattern, string, timeout=5, default=None, **kwargs): """replacement for re.match Args: @@ -55,12 +55,12 @@ def match(pattern, string, timeout=5, default=None, *args, **kwargs): Match: Match object or None """ try: - return regex.match(pattern, string, timeout=timeout, *args, **kwargs) + return regex.match(pattern, string, timeout=timeout, **kwargs) except TimeoutError: return default @staticmethod - def sub(pattern, repl, string, timeout=5, default='', *args, **kwargs): + def sub(pattern, repl, string, timeout=5, default='', **kwargs): """replacement for re.sub Args: @@ -74,12 +74,12 @@ def sub(pattern, repl, string, timeout=5, default='', *args, **kwargs): str: string """ try: - return regex.sub(pattern, repl, string, timeout=timeout, *args, **kwargs) + return regex.sub(pattern, repl, string, timeout=timeout, **kwargs) except TimeoutError: return default @staticmethod - def finditer(pattern, string, timeout=5, default=None, *args, **kwargs): + def finditer(pattern, string, timeout=5, default=None, **kwargs): """replacement for re.finditer Args: @@ -92,6 +92,6 @@ def finditer(pattern, string, timeout=5, default=None, *args, **kwargs): Scanner: Scanner object or None """ try: - return regex.finditer(pattern, string, timeout=timeout, *args, **kwargs) + return regex.finditer(pattern, string, timeout=timeout, **kwargs) except TimeoutError: return default