Skip to content

Commit de3d75a

Browse files
apply lint for retry related codes
Signed-off-by: hirokuni-kitahara <[email protected]>
1 parent baa673e commit de3d75a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/pdl/pdl_dumper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def block_to_dict( # noqa: C901
127127
if block.retry is not None:
128128
d["retry"] = expr_to_dict(block.retry, json_compatible)
129129
if block.trace_error_on_retry is not None:
130-
d["trace_error_on_retry"] = expr_to_dict(block.trace_error_on_retry, json_compatible)
130+
d["trace_error_on_retry"] = expr_to_dict(
131+
block.trace_error_on_retry, json_compatible
132+
)
131133
if isinstance(block, StructuredBlock):
132134
d["context"] = block.context
133135

src/pdl/pdl_interpreter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,10 @@ def process_advanced_block(
439439
raise exc from exc
440440
if do_retry:
441441
error = f"An error occurred in a PDL block. Error details: {err_msg}"
442-
print(f"\n\033[0;31m[Retry {trial_idx+1}/{max_retry}] {error}\033[0m\n", file=sys.stderr)
442+
print(
443+
f"\n\033[0;31m[Retry {trial_idx+1}/{max_retry}] {error}\033[0m\n",
444+
file=sys.stderr,
445+
)
443446
if block.trace_error_on_retry:
444447
scope = set_error_to_scope_for_retry(scope, error, block.pdl__id)
445448
continue

tests/test_retry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import io
2-
from contextlib import redirect_stdout, redirect_stderr
2+
from contextlib import redirect_stderr, redirect_stdout
33

44
from pdl.pdl import exec_dict
55

0 commit comments

Comments
 (0)