Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tehrengruber committed Nov 27, 2024
1 parent 9d2e87b commit ad1e5eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gt4py/next/program_processors/runners/gtfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ def __init__(self, directory: Optional[str | pathlib.Path] = None, **settings: A
with lock:
super().__init__(directory=directory, **settings)

self._init_complete = True

def __del__(self) -> None:
self.close()
if getattr(self, "_init_complete", False): # skip if `__init__` didn't finished
self.close()


class GTFNCompileWorkflowFactory(factory.Factory):
Expand Down

0 comments on commit ad1e5eb

Please sign in to comment.