TaskGroup: Use explicit None check for cancellation error (#114708)

This commit is contained in:
Matan Perelman 2024-01-29 21:12:33 +02:00 committed by GitHub
parent aa3402ad45
commit 29952c86f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -132,7 +132,7 @@ async def __aexit__(self, et, exc, tb):
# Propagate CancelledError if there is one, except if there
# are other errors -- those have priority.
if propagate_cancellation_error and not self._errors:
if propagate_cancellation_error is not None and not self._errors:
raise propagate_cancellation_error
if et is not None and not issubclass(et, exceptions.CancelledError):