File tree 2 files changed +18
-6
lines changed
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 24
24
except :
25
25
from .task import TaskQueue , Task
26
26
27
+ # Depending on the version of CircuitPython, these errors may exist in the build-in C code
28
+ # even if _asyncio exists
29
+ try :
30
+ from _asyncio import CancelledError , InvalidStateError
31
+ except :
32
+ from .task import CancelledError , InvalidStateError
27
33
28
34
################################################################################
29
35
# Exceptions
30
36
31
37
32
- class CancelledError (BaseException ):
33
- """Injected into a task when calling `Task.cancel()`"""
34
-
35
- pass
36
-
37
-
38
38
class TimeoutError (Exception ):
39
39
"""Raised when waiting for a task longer than the specified timeout."""
40
40
Original file line number Diff line number Diff line change 21
21
from . import core
22
22
23
23
24
+ class CancelledError (BaseException ):
25
+ """Injected into a task when calling `Task.cancel()`"""
26
+
27
+ pass
28
+
29
+
30
+ class InvalidStateError (Exception ):
31
+ """Can be raised in situations like setting a result value for a task object that already has a result value set."""
32
+
33
+ pass
34
+
35
+
24
36
# pairing-heap meld of 2 heaps; O(1)
25
37
def ph_meld (h1 , h2 ):
26
38
if h1 is None :
You can’t perform that action at this time.
0 commit comments