Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions aws_advanced_python_wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,13 @@ def release_resources(self):
def _unwrap(self, unwrap_class: Type[UnwrapType]) -> Optional[UnwrapType]:
return self._plugin_manager._unwrap(unwrap_class)

def __del__(self):
self.release_resources()

def __enter__(self: AwsWrapperConnection) -> AwsWrapperConnection:
return self

def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
self._plugin_manager.execute(self.target_connection, DbApiMethod.CONNECTION_CLOSE,
lambda: self.target_connection.close(), exc_type, exc_val, exc_tb)
self.release_resources()


class AwsWrapperCursor(Cursor):
Expand Down
Loading