fix: close the motor client if an invalid db name raises in __init__ (mongo-9)
self._client[database] can raise InvalidName after the client is already built, leaking it via any exception traceback the caller holds. close it before re-raising, matching the __aenter__ leak fix. also compresses essay docstrings/comments across the module with no behavior change, keeping the swallow-and-default contract note and the matched_count/nInserted footguns. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "mongo"
|
||||
version = "0.1.7"
|
||||
version = "0.1.8"
|
||||
description = "async mongodb wrapper over motor with a raw escape hatch"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
Reference in New Issue
Block a user