From 9462bb103bae2925dfeec34d610a5a7ac9407d4f Mon Sep 17 00:00:00 2001 From: Steve Holden Date: Sat, 21 Dec 2024 16:43:07 +0000 Subject: [PATCH] Fix style to keep ruff and black happy. --- src/hu/dotted_dict.py | 4 ++-- src/hu/object_dict.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hu/dotted_dict.py b/src/hu/dotted_dict.py index daa7254..6d38b85 100644 --- a/src/hu/dotted_dict.py +++ b/src/hu/dotted_dict.py @@ -27,7 +27,7 @@ def _apply_key(self, o, k): except ValueError: raise KeyError("Non-integer list subscript") except IndexError: - raise KeyError('Invalid list index at end of "{}"'.format(k[: self.pos])) + raise KeyError(f'Invalid list index at end of "{k[: self.pos]}"') except KeyError: raise KeyError( 'Unrecognised field name at end of "{}"'.format(k[: self.pos]) @@ -111,6 +111,6 @@ def _raise_error_if_syntax_error(self, key, match): if match is None: raise KeyError( "Cannot find name or list subscript at start of {!r}".format( - key[self.current_position:] + key[self.current_position :] ) ) diff --git a/src/hu/object_dict.py b/src/hu/object_dict.py index 6fcd128..8efc338 100644 --- a/src/hu/object_dict.py +++ b/src/hu/object_dict.py @@ -44,10 +44,11 @@ def __init__(self, arg=sentinel): if arg is self.sentinel: # Called without args arg = {} - # Allows the underlying dict class to handle the arg as it usually would + # Allows the underlying dict class to handle the arg + # as it usually would super(ObjectDict, self).__init__(arg) - for (k, v) in self.items(): + for k, v in self.items(): self[k] = ObjectDict(v) def __delattr__(self, name):