Skip to content

Commit

Permalink
silence some pylance warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Mar 15, 2024
1 parent 2757da7 commit 45db0e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions har2locust/extra_plugins/plugin_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class T(ast.NodeTransformer):
def visit_Dict(self, node: ast.Dict) -> ast.Dict:
for key in node.keys:
if typing.cast(ast.Constant, key).s == "bet_number":
node.values[node.keys.index(key)] = ast.parse('f"single_{id}"').body[0]
node.values[node.keys.index(key)] = ast.parse('f"single_{id}"').body[0] # type: ignore
for correlation in correlations:
_, _, *corr_vars = correlation.split(",")
if typing.cast(ast.Constant, key).s in corr_vars:
Expand All @@ -122,7 +122,7 @@ def visit_With(self, node: ast.With) -> ast.With:
for correlation in correlations:
url, corr_expr, *corr_vars = correlation.split(",")
if url == node.items[0].context_expr.args[1].value: # type: ignore
node.body[0] = ast.parse(
node.body[0] = ast.parse( # type: ignore
f"""{corr_vars[0].replace('-', '_')} = re.findall('''{corr_expr}''', resp.text)[0] if resp.text else None"""
)
self.generic_visit(node)
Expand Down

0 comments on commit 45db0e9

Please sign in to comment.