From 30ffb6473393760d57a934a800788167d8a7f380 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Thu, 29 Aug 2024 16:00:47 -0500 Subject: [PATCH] fix: cleanup --- ape_vyper/compiler.py | 3 +++ tests/test_compiler.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ape_vyper/compiler.py b/ape_vyper/compiler.py index 8632547..cf6399b 100644 --- a/ape_vyper/compiler.py +++ b/ape_vyper/compiler.py @@ -994,6 +994,9 @@ def compile_code( # Not sure when this would happen. raise VyperCompileError("Failed to produce contract type.") + # Clean-up (just in case) + file.unlink(missing_ok=True) + return contract_type def _source_vyper_version(self, code: str) -> Version: diff --git a/tests/test_compiler.py b/tests/test_compiler.py index 1b6a6cd..1c3e862 100644 --- a/tests/test_compiler.py +++ b/tests/test_compiler.py @@ -566,7 +566,7 @@ def test_enrich_error_handle_when_name(compiler, geth_provider, mocker): tb = mocker.MagicMock() tb.revert_type = "NONPAYABLE_CHECK" - error = ContractLogicError("", source_traceback=tb) + error = ContractLogicError(None, source_traceback=tb) new_error = compiler.enrich_error(error) assert isinstance(new_error, NonPayableError)