Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 5, 2023
1 parent 6ba4260 commit 83a27e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions vyper/cli/vyper_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ def get_output_formats(input_dict: dict, targets: list[PurePath]) -> dict[PurePa
outputs = sorted(set(outputs))

if path == "*":
output_keys = targets
output_paths = targets
else:
output_keys = [PurePath(path)]
if output_keys[0] not in targets:
raise JSONError(f"outputSelection references unknown contract '{output_keys[0]}'")
output_paths = [PurePath(path)]
if output_paths[0] not in targets:
raise JSONError(f"outputSelection references unknown contract '{output_paths[0]}'")

for key in output_keys:
output_formats[key] = outputs
for path in output_paths:

Check notice

Code scanning / CodeQL

Nested loops with same variable Note

Nested for statement uses loop variable 'path' of enclosing
for statement
.
output_formats[path] = outputs

return output_formats

Expand Down Expand Up @@ -297,7 +297,7 @@ def compile_from_input_dict(
assert isinstance(file, FileInput) # mypy hint
data = vyper.compile_code(
file.source_code,
contract_name=file.path,
contract_name=str(file.path),
input_bundle=input_bundle,
output_formats=output_formats[contract_path],
source_id=file.source_id,
Expand Down
2 changes: 1 addition & 1 deletion vyper/compiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

def compile_code(
contract_source: str,
contract_name: PathLike = UNKNOWN_CONTRACT_NAME,
contract_name: str = UNKNOWN_CONTRACT_NAME,
source_id: int = 0,
input_bundle: InputBundle = None,
settings: Settings = None,
Expand Down

0 comments on commit 83a27e6

Please sign in to comment.