Skip to content

Commit

Permalink
Fix mypy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Nov 13, 2023
1 parent c06df0b commit e51ba57
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crytic_compile/platform/etherscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,15 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
try:
# etherscan might return an object with two curly braces, {{ content }}
dict_source_code = json.loads(source_code[1:-1])
assert isinstance(dict_source_code, dict)
filenames, working_dir, remappings = _handle_multiple_files(
dict_source_code, addr, prefix, contract_name, export_dir
)
except JSONDecodeError:
try:
# or etherscan might return an object with single curly braces, { content }
dict_source_code = json.loads(source_code)
assert isinstance(dict_source_code, dict)
filenames, working_dir, remappings = _handle_multiple_files(
dict_source_code, addr, prefix, contract_name, export_dir
)
Expand Down

0 comments on commit e51ba57

Please sign in to comment.