]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
TaskGroup: Use explicit None check for cancellation error (#114708)
authorMatan Perelman <matan1008@gmail.com>
Mon, 29 Jan 2024 19:12:33 +0000 (21:12 +0200)
committerGitHub <noreply@github.com>
Mon, 29 Jan 2024 19:12:33 +0000 (11:12 -0800)
Lib/asyncio/taskgroups.py

index e1c56d140bef7de4bf1d1685525850ee934bc73b..f322b1f6653f6a22518b4028e77e133fb72a2e4f 100644 (file)
@@ -132,7 +132,7 @@ class TaskGroup:
 
         # 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):