File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2121# Import TaskQueue and Task, preferring built-in C code over Python code
2222try :
2323 from _asyncio import TaskQueue , Task
24- except :
24+ except ImportError :
2525 from .task import TaskQueue , Task
2626
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.
2930try :
3031 from _asyncio import CancelledError , InvalidStateError
31- except :
32+ except ( ImportError , AttributeError ) :
3233 from .task import CancelledError , InvalidStateError
3334
3435################################################################################
You can’t perform that action at this time.
0 commit comments