File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 21
21
# Import TaskQueue and Task, preferring built-in C code over Python code
22
22
try :
23
23
from _asyncio import TaskQueue , Task
24
- except :
24
+ except ImportError :
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
27
+ # Depending on the release of CircuitPython these errors may or may not
28
+ # exist in the C implementation of `_asyncio`. However, when they
29
+ # do exist, must be preferred over the Python code.
29
30
try :
30
31
from _asyncio import CancelledError , InvalidStateError
31
- except :
32
+ except ( ImportError , AttributeError ) :
32
33
from .task import CancelledError , InvalidStateError
33
34
34
35
################################################################################
You can’t perform that action at this time.
0 commit comments