Skip to content

Commit 2084f95

Browse files
committed
Fixed ast.With
1 parent f266a65 commit 2084f95

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

bzt/modules/_apiritif/generator.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -773,10 +773,11 @@ def _gen_action(self, action_config, parent_request=None, index_label=""):
773773
label = self._create_action_label(parent_request.label, index_label, action)
774774

775775
return [ast.With(
776-
context_expr=ast_call(
777-
func=ast_attr("apiritif.transaction"),
778-
args=[self._gen_expr(label)]),
779-
optional_vars=None,
776+
items=[ast.withitem(
777+
context_expr=ast_call(
778+
func=ast_attr("apiritif.transaction"),
779+
args=[self._gen_expr(label)]),
780+
optional_vars=None)],
780781
body=[ast.Expr(element) for element in action_elements])]
781782

782783
return [ast.Expr(element) for element in action_elements]
@@ -903,10 +904,11 @@ def _gen_loop_mngr(self, action_config, parent_request=None, index_label=""):
903904
action_lines = self._gen_action(action)
904905

905906
transaction = ast.With(
906-
context_expr=ast_call(
907-
func=ast_attr("apiritif.transaction"),
908-
args=[self._gen_expr(label)]),
909-
optional_vars=None,
907+
items=[ast.withitem(
908+
context_expr=ast_call(
909+
func=ast_attr("apiritif.transaction"),
910+
args=[self._gen_expr(label)]),
911+
optional_vars=None)],
910912
body=[action_lines])
911913

912914
body.append([transaction])
@@ -2041,10 +2043,11 @@ def _gen_transaction(self, trans_conf, transaction_class="apiritif.smart_transac
20412043
body.append(self._gen_http_request(request))
20422044

20432045
transaction = ast.With(
2044-
context_expr=ast_call(
2045-
func=ast_attr(transaction_class),
2046-
args=[self._gen_expr(trans_conf.label)]),
2047-
optional_vars=None,
2046+
items=[ast.withitem(
2047+
context_expr=ast_call(
2048+
func=ast_attr(transaction_class),
2049+
args=[self._gen_expr(trans_conf.label)]),
2050+
optional_vars=None)],
20482051
body=body)
20492052

20502053
return transaction

0 commit comments

Comments
 (0)