Skip to content

Commit 9a63bf3

Browse files
committed
update
1 parent cc7ca2f commit 9a63bf3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lightning/pytorch/plugins/io/async_plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ def _save_checkpoint(*args: Any, **kwargs: Any) -> None:
8080
@override
8181
def teardown(self) -> None:
8282
"""This method is called to close the threads."""
83-
if self._executor is None:
84-
return
85-
self._executor.shutdown(wait=True)
86-
self._executor = None
83+
if self._executor is not None:
84+
self._executor.shutdown(wait=True)
85+
self._executor = None
8786

8887
# if an error was raised anytime in any of the `executor.submit` calls
8988
if self._error:

0 commit comments

Comments
 (0)