Skip to content

Commit 7b076f1

Browse files
authored
Merge pull request #241 from KumarLabJax/version-bump
bump version to 0.38.0
2 parents de841ce + e330a5c commit 7b076f1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "jabs-behavior-classifier"
3-
version = "0.37.1"
3+
version = "0.38.0"
44
description = ""
55
readme = "README.md"
66
requires-python = ">=3.10,<3.14"

src/jabs/project/project.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)