From 66bac3df1748ff263c991e121b3ce80599807998 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 9 Dec 2024 12:14:13 -0600 Subject: Fix issues caught by linter. --- gn_libs/mysqldb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gn_libs') diff --git a/gn_libs/mysqldb.py b/gn_libs/mysqldb.py index 764412f..64a649d 100644 --- a/gn_libs/mysqldb.py +++ b/gn_libs/mysqldb.py @@ -19,7 +19,7 @@ def __parse_boolean__(val: str) -> bool: """Check whether the variable 'val' has the string value `true`.""" true_vals = ("t", "T", "true", "TRUE", "True") false_vals = ("f", "F", "false", "FALSE", "False") - if (val.strip() not in (true_vals + false_vals)): + if val.strip() not in true_vals + false_vals: raise InvalidOptionValue(f"Invalid value: {val}") return val.strip().lower() in true_vals @@ -29,7 +29,7 @@ def __non_negative_int__(val: str) -> int: error_message = f"Expected a non-negative value. Got {val}" try: _val = int(val) - if (_val < 0): + if _val < 0: raise InvalidOptionValue(error_message) return _val except ValueError as verr: @@ -40,7 +40,7 @@ def __parse_ssl_mode_options__(val: str) -> str: mode_opts = ( "DISABLED", "PREFERRED", "REQUIRED", "VERIFY_CA", "VERIFY_IDENTITY") _val = val.strip().upper() - if(_val not in mode_opts): + if _val not in mode_opts: raise InvalidOptionValue(f"Invalid ssl_mode option: {_val}") return _val -- cgit v1.2.3