Skip to content

Commit

Permalink
manually order destruction of zipfile child
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed May 5, 2024
1 parent d754b02 commit 3c8a0ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vyper/compiler/output_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ def __init__(self, compiler_data: CompilerData):
method = _get_compression_method()
self.archive = zipfile.ZipFile(self._buf, mode="w", compression=method, compresslevel=9)

def __del__(self):
# manually order the destruction of child objects.
# cf. https://bugs.python.org/issue37773
del self.archive
del self._buf

def write_sources(self, sources: dict[str, CompilerInput]):
for path, c in sources.items():
self.archive.writestr(_anonymize(path), c.contents)
Expand Down

0 comments on commit 3c8a0ed

Please sign in to comment.