File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -818,7 +818,7 @@ def _run(self):
818818 )
819819 super ()._run ()
820820
821- def __del__ (self ):
821+ def _finalize (self ):
822822 if isinstance (self .plot_subprocess , subprocess .Popen ) and self .plot_subprocess .poll () is None :
823823 log .info ('Terminating subprocess: online plots' )
824824 self .plot_subprocess .terminate ()
Original file line number Diff line number Diff line change 1616import sys
1717import time
1818import traceback
19+ import weakref
1920from abc import ABC , abstractmethod
2021from collections import OrderedDict
2122from collections .abc import Callable
@@ -201,6 +202,10 @@ def __init__(
201202 stub ,
202203 extractors = self .extractor_tasks ,
203204 )
205+ self .finalize = weakref .finalize (self , self ._finalize )
206+
207+ def _finalize (self ): # noqa: B027
208+ """Clean-up tasks prior to destroying the object"""
204209
205210 @property
206211 def session_path (self ) -> Path | None :
You can’t perform that action at this time.
0 commit comments