File tree 2 files changed +11
-15
lines changed
2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 24
24
except ImportError :
25
25
from .task import TaskQueue , Task
26
26
27
+ ################################################################################
28
+ # Exceptions
29
+
30
+
27
31
# Depending on the release of CircuitPython these errors may or may not
28
32
# exist in the C implementation of `_asyncio`. However, when they
29
33
# do exist, they must be preferred over the Python code.
30
34
try :
31
35
from _asyncio import CancelledError , InvalidStateError
32
36
except (ImportError , AttributeError ):
33
- from .task import CancelledError , InvalidStateError
37
+ class CancelledError (BaseException ):
38
+ """Injected into a task when calling `Task.cancel()`"""
39
+ pass
34
40
35
- ################################################################################
36
- # Exceptions
41
+
42
+ class InvalidStateError (Exception ):
43
+ """Can be raised in situations like setting a result value for a task object that already has a result value set."""
44
+ pass
37
45
38
46
39
47
class TimeoutError (Exception ):
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
-
36
24
# pairing-heap meld of 2 heaps; O(1)
37
25
def ph_meld (h1 , h2 ):
38
26
if h1 is None :
You can’t perform that action at this time.
0 commit comments