mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-21 08:29:41 +00:00
iterate over args directly without indexing
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
@ -335,12 +335,7 @@ def log_call_deferred(action_type):
|
|||||||
kwargs = {k: bytes_to_unicode(True, kw[k]) for k in kw}
|
kwargs = {k: bytes_to_unicode(True, kw[k]) for k in kw}
|
||||||
# Remove complex (unserializable) objects from positional args to
|
# Remove complex (unserializable) objects from positional args to
|
||||||
# prevent eliot from throwing errors when it attempts serialization
|
# prevent eliot from throwing errors when it attempts serialization
|
||||||
args = tuple(
|
args = tuple(arg if is_json_serializable(arg) else str(arg) for arg in a)
|
||||||
a[pos]
|
|
||||||
if is_json_serializable(a[pos])
|
|
||||||
else str(a[pos])
|
|
||||||
for pos in range(len(a))
|
|
||||||
)
|
|
||||||
with start_action(action_type=action_type, args=args, kwargs=kwargs).context():
|
with start_action(action_type=action_type, args=args, kwargs=kwargs).context():
|
||||||
# Use addActionFinish so that the action finishes when the
|
# Use addActionFinish so that the action finishes when the
|
||||||
# Deferred fires.
|
# Deferred fires.
|
||||||
|
Reference in New Issue
Block a user