Skip to content

Commit b373acc

Browse files
authored
Refactor __exit__ method for better readability
1 parent 64b4cdb commit b373acc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pythainlp/tag/crfchunk.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ def __enter__(self) -> CRFchunk:
9393
"""Context manager entry."""
9494
return self
9595

96-
def __exit__(self, exc_type: Optional[type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[types.TracebackType]) -> bool:
96+
def __exit__(
97+
self,
98+
exc_type: Optional[type[BaseException]],
99+
exc_val: Optional[BaseException],
100+
exc_tb: Optional[types.TracebackType]
101+
) -> bool:
97102
"""Context manager exit - clean up resources."""
98103
if self._model_file_ctx is not None:
99104
try:

0 commit comments

Comments
 (0)