Skip to content

Commit f8c320e

Browse files
authored
Added missing slots to context managers (#763)
* Add missing slot to context managers * Bump version and fix CHANGES
1 parent 78543a1 commit f8c320e

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Diff for: CHANGES.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.1.0b2 (2020-12-09)
2+
^^^^^^^^^^^^^^^^^^^^
3+
4+
* Added missing slots to context managers `#763 <https://github.com/aio-libs/aiopg/pull/763>`_
5+
6+
17
1.1.0b1 (2020-12-07)
28
^^^^^^^^^^^^^^^^^^^^
39

Diff for: aiopg/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
'Connection', 'Cursor', 'Pool', 'version', 'version_info',
2222
'DEFAULT_TIMEOUT', 'IsolationLevel', 'Transaction')
2323

24-
__version__ = '1.1.0b1'
24+
__version__ = '1.1.0b2'
2525

2626
version = __version__ + ' , Python ' + sys.version
2727

Diff for: aiopg/utils.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ async def __aexit__(self, exc_type, exc, tb):
100100

101101

102102
class _SAConnectionContextManager(_ContextManager):
103+
__slots__ = ()
104+
103105
def __aiter__(self):
104106
return self
105107

@@ -108,21 +110,25 @@ async def __anext__(self):
108110
self._obj = await self._coro
109111

110112
try:
111-
return (await self._obj.__anext__())
113+
return await self._obj.__anext__()
112114
except StopAsyncIteration:
113115
self._obj.close()
114116
self._obj = None
115117
raise
116118

117119

118120
class _PoolContextManager(_ContextManager):
121+
__slots__ = ()
122+
119123
async def __aexit__(self, exc_type, exc, tb):
120124
self._obj.close()
121125
await self._obj.wait_closed()
122126
self._obj = None
123127

124128

125129
class _TransactionPointContextManager(_ContextManager):
130+
__slots__ = ()
131+
126132
async def __aexit__(self, exc_type, exc_val, exc_tb):
127133
if exc_type is not None:
128134
await self._obj.rollback_savepoint()
@@ -133,6 +139,8 @@ async def __aexit__(self, exc_type, exc_val, exc_tb):
133139

134140

135141
class _TransactionBeginContextManager(_ContextManager):
142+
__slots__ = ()
143+
136144
async def __aexit__(self, exc_type, exc_val, exc_tb):
137145
if exc_type is not None:
138146
await self._obj.rollback()
@@ -143,6 +151,8 @@ async def __aexit__(self, exc_type, exc_val, exc_tb):
143151

144152

145153
class _TransactionContextManager(_ContextManager):
154+
__slots__ = ()
155+
146156
async def __aexit__(self, exc_type, exc, tb):
147157
if exc_type:
148158
await self._obj.rollback()

0 commit comments

Comments
 (0)