Skip to content

Commit cec85c1

Browse files
authored
Merge pull request #20 from oremanj/exitfixes
Mark context manager exits that can't swallow exceptions as returning None
2 parents 7950ae8 + 92cdd37 commit cec85c1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

trio-stubs/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class CapacityLimiter:
204204
def release_on_behalf_of(self, borrower: object) -> None: ...
205205
def statistics(self) -> _Statistics: ...
206206
async def __aenter__(self) -> None: ...
207-
async def __aexit__(self, *exc: object) -> bool: ...
207+
async def __aexit__(self, *exc: object) -> None: ...
208208

209209
class Semaphore:
210210
value: int
@@ -215,7 +215,7 @@ class Semaphore:
215215
def release(self) -> None: ...
216216
def statistics(self) -> _Statistics: ...
217217
async def __aenter__(self) -> None: ...
218-
async def __aexit__(self, *exc: object) -> bool: ...
218+
async def __aexit__(self, *exc: object) -> None: ...
219219

220220
class Lock:
221221
def locked(self) -> bool: ...
@@ -224,7 +224,7 @@ class Lock:
224224
def release(self) -> None: ...
225225
def statistics(self) -> _Statistics: ...
226226
async def __aenter__(self) -> None: ...
227-
async def __aexit__(self, *exc: object) -> bool: ...
227+
async def __aexit__(self, *exc: object) -> None: ...
228228

229229
class StrictFIFOLock(Lock):
230230
pass
@@ -240,7 +240,7 @@ class Condition:
240240
def notify_all(self) -> None: ...
241241
def statistics(self) -> _Statistics: ...
242242
async def __aenter__(self) -> None: ...
243-
async def __aexit__(self, *exc: object) -> bool: ...
243+
async def __aexit__(self, *exc: object) -> None: ...
244244

245245
# _highlevel_generic
246246
async def aclose_forcefully(resource: trio.abc.AsyncResource) -> None: ...

trio-stubs/abc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class AsyncResource(metaclass=ABCMeta):
5252
@abstractmethod
5353
async def aclose(self) -> None: ...
5454
async def __aenter__(self: T) -> T: ...
55-
async def __aexit__(self, *exc: object) -> bool: ...
55+
async def __aexit__(self, *exc: object) -> None: ...
5656

5757
class SendStream(AsyncResource):
5858
@abstractmethod

0 commit comments

Comments
 (0)