File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 2424except ImportError :
2525 from .task import TaskQueue , Task
2626
27+ ################################################################################
28+ # Exceptions
29+
30+
2731# Depending on the release of CircuitPython these errors may or may not
2832# exist in the C implementation of `_asyncio`. However, when they
2933# do exist, they must be preferred over the Python code.
3034try :
3135 from _asyncio import CancelledError , InvalidStateError
3236except (ImportError , AttributeError ):
33- from .task import CancelledError , InvalidStateError
37+ class CancelledError (BaseException ):
38+ """Injected into a task when calling `Task.cancel()`"""
39+ pass
3440
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
3745
3846
3947class TimeoutError (Exception ):
Original file line number Diff line number Diff line change 2121from . import core
2222
2323
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-
3624# pairing-heap meld of 2 heaps; O(1)
3725def ph_meld (h1 , h2 ):
3826 if h1 is None :
You can’t perform that action at this time.
0 commit comments