Only set shield flag when trio nursery mode is used

one_ring_to_rule_them_all
Guillermo Rodriguez 2025-04-13 14:16:39 -03:00
parent 9b16eeed2f
commit 4ca1aaeaeb
No known key found for this signature in database
GPG Key ID: 002CC5F1E6BDA53E
1 changed files with 2 additions and 1 deletions

View File

@ -70,6 +70,7 @@ async def maybe_open_nursery(
yield nursery
else:
async with lib.open_nursery(**kwargs) as nursery:
if lib == trio:
nursery.cancel_scope.shield = shield
yield nursery