MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / close

Method close

pymongo/synchronous/encryption.py:1264–1279  ·  view source on GitHub ↗

Release resources. Note that using this class in a with-statement will automatically call :meth:`close`:: with ClientEncryption(...) as client_encryption: encrypted = client_encryption.encrypt(value, ...) decrypted = client_encryption.dec

(self)

Source from the content-addressed store, hash-verified

1262 raise InvalidOperation("Cannot use closed ClientEncryption")
1263
1264 def close(self) -> None:
1265 """Release resources.
1266
1267 Note that using this class in a with-statement will automatically call
1268 :meth:`close`::
1269
1270 with ClientEncryption(...) as client_encryption:
1271 encrypted = client_encryption.encrypt(value, ...)
1272 decrypted = client_encryption.decrypt(encrypted)
1273
1274 """
1275 if self._io_callbacks:
1276 self._io_callbacks.close()
1277 self._encryption.close()
1278 self._io_callbacks = None
1279 self._encryption = None

Callers 1

__exit__Method · 0.95

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected