Skip to content

Commit

Permalink
fixed the destructor in Infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme1 committed Nov 1, 2023
1 parent 6e03c9d commit 186a0cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dpipe/batch_iter/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
if self.pipeline is not None:
# need getattr here, because the destructor might get called before the field is initialized
if getattr(self, 'pipeline', None) is not None:
self.pipeline, pipeline = None, self.pipeline
return pipeline.__exit__(exc_type, exc_val, exc_tb)

Expand Down

0 comments on commit 186a0cd

Please sign in to comment.