diff options
author | Frederick Muriuki Muriithi | 2024-12-09 12:14:13 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-12-09 12:14:13 -0600 |
commit | 66bac3df1748ff263c991e121b3ce80599807998 (patch) | |
tree | 584e38d8c2d194fab8523afe7c083167a89b6198 | |
parent | 8fe95f372857a09c42ff9341a0e5439924b068df (diff) | |
download | gn-libs-66bac3df1748ff263c991e121b3ce80599807998.tar.gz |
Fix issues caught by linter.
-rw-r--r-- | gn_libs/mysqldb.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |