Skip to content

Commit b4ffca2

Browse files
Merge pull request #1546 from eth-brownie/fix-vyper-sourcemap
fix: handle StopIteration when building vyper pcMap
2 parents 2453e82 + 94e6c97 commit b4ffca2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

brownie/project/compiler/vyper.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,12 @@ def _generate_coverage_data(
365365
if pc_list[-1]["op"] not in ("JUMPI", "REVERT"):
366366
continue
367367

368-
node = _find_node_by_offset(ast_json, offset)
368+
try:
369+
node = _find_node_by_offset(ast_json, offset)
370+
except StopIteration:
371+
# TODO in vyper >0.3.3 this sometimes fails - unsure if the issue is in brownie or vyper
372+
continue
373+
369374
if pc_list[-1]["op"] == "REVERT" or _is_revert_jump(pc_list[-2:], revert_pc):
370375
# custom revert error strings
371376
if node["ast_type"] == "FunctionDef":

0 commit comments

Comments
 (0)