File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " jabs-behavior-classifier"
3- version = " 0.37.1 "
3+ version = " 0.38.0 "
44description = " "
55readme = " README.md"
66requires-python = " >=3.10,<3.14"
Original file line number Diff line number Diff line change @@ -119,9 +119,14 @@ def _ensure_executor(self) -> ProcessPoolExecutor:
119119
120120 def shutdown_executor (self ) -> None :
121121 """Shut down the persistent executor (call on app exit)."""
122- if self ._executor is not None :
122+ # We need to be defensive against partially constructed Project instances where __init__ may have
123+ # raised an Exception before self._executor was declared and then shutdown_executor is called by __del__.
124+ # In that case, the attribute may not exist, so we can't access the attribute directly here -- use
125+ # getattr instead.
126+ executor = getattr (self , "_executor" , None )
127+ if executor is not None :
123128 with contextlib .suppress (Exception ):
124- self . _executor .shutdown (cancel_futures = False )
129+ executor .shutdown (cancel_futures = False )
125130 self ._executor = None
126131 self ._executor_size = 0
127132
You can’t perform that action at this time.
0 commit comments