Skip to content

Commit

Permalink
Fixed service resource context manager exit
Browse files Browse the repository at this point in the history
  • Loading branch information
terricain committed Mar 12, 2022
1 parent 3861949 commit 7dbd51a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions aioboto3/resources/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import warnings

from boto3.resources.base import ServiceResource

Expand All @@ -10,8 +11,8 @@ async def __aenter__(self):
return self

async def __aexit__(self, exc_type, exc_val, exc_tb):
await self.meta.client.close()
return False
await self.meta.client.__aexit__(exc_type, exc_val, exc_tb)

def close(self):
warnings.warn("This should not be called anymore", DeprecationWarning)
return self.meta.client.close()
2 changes: 1 addition & 1 deletion aioboto3/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ async def __aenter__(self):
return self.cls

async def __aexit__(self, exc_type, exc, tb):
await self.cls.close()
await self.cls.__aexit__(exc_type, exc, tb)

0 comments on commit 7dbd51a

Please sign in to comment.