Skip to content

Commit

Permalink
Clean up some bits
Browse files Browse the repository at this point in the history
  • Loading branch information
gschaffner committed Sep 21, 2024
1 parent ee9d6a2 commit ec27a9d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/anyio/_backends/_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,8 @@ def __exit__(
cannot_swallow_exc_val = False
if exc_val is not None:
for exc in iterate_exceptions(exc_val):
if isinstance(exc, CancelledError):
if is_anyio_cancellation(exc):
self._cancelled_caught = True
else:
cannot_swallow_exc_val = True
if isinstance(exc, CancelledError) and is_anyio_cancellation(exc):
self._cancelled_caught = True
else:
cannot_swallow_exc_val = True

Expand All @@ -498,6 +495,7 @@ def __exit__(
self._parent_scope._pending_uncancellations += (
self._pending_uncancellations
)
self._pending_uncancellations = 0

return False

Expand Down

0 comments on commit ec27a9d

Please sign in to comment.