Skip to content

Commit 0d88686

Browse files
authored
Merge pull request #10661 from dhalbert/import-lib-traversable
circuitpython_setboard: handle new location of importlib Traversable
2 parents f263b78 + a55305e commit 0d88686

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/board_stubs/circuitpython_setboard/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
import shutil
1313
from collections import defaultdict
1414
from importlib import resources
15-
from importlib.abc import Traversable
15+
16+
try:
17+
from importlib.resources.abc import Traversable
18+
except ModuleNotFoundError:
19+
# 3.10 and earlier.
20+
from importlib.abc import Traversable
1621

1722

1823
def get_definitions_or_exit(board: str) -> Traversable:

0 commit comments

Comments
 (0)