Skip to content

Commit 97a5b6b

Browse files
committed
cleanup
1 parent cea3e84 commit 97a5b6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/service-library/src/servicelib/async_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,17 @@ def _get_context(args: Any, kwargs: dict) -> Context:
133133
sub_args = arg.split(".")
134134
main_arg = sub_args[0]
135135
if main_arg not in search_args:
136-
raise ValueError(
136+
msg = (
137137
f"Expected '{main_arg}' in '{decorated_function.__name__}'"
138138
f" arguments. Got '{search_args}'"
139139
)
140+
raise ValueError(msg)
140141
context_key = search_args[main_arg]
141142
for attribute in sub_args[1:]:
142143
potential_key = getattr(context_key, attribute)
143144
if not potential_key:
144-
raise ValueError(
145-
f"Expected '{attribute}' attribute in '{context_key.__name__}' arguments."
146-
)
145+
msg = f"Expected '{attribute}' attribute in '{context_key.__name__}' arguments."
146+
raise ValueError(msg)
147147
context_key = potential_key
148148

149149
key_parts.append(f"{decorated_function.__name__}_{context_key}")

0 commit comments

Comments
 (0)