File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
micropython/lora/lora/lora Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 55
66ok = False # Flag if at least one modem driver package is installed
77
8+
9+ def _can_ignore_error (e ):
10+ """Check if ImportError can be ignored due to missing module."""
11+ return all (x in str (e ) for x in ["no module named" , "lora" ])
12+
13+
814# Various lora "sub-packages"
915
1016try :
1117 from .sx126x import * # noqa: F401
1218
1319 ok = True
1420except ImportError as e :
15- if "no module named 'lora." not in str (e ):
21+ if not _can_ignore_error (e ):
1622 raise
1723
1824try :
1925 from .sx127x import * # noqa: F401
2026
2127 ok = True
2228except ImportError as e :
23- if "no module named 'lora." not in str (e ):
29+ if not _can_ignore_error (e ):
2430 raise
2531
2632try :
2733 from .stm32wl5 import * # noqa: F401
2834
2935 ok = True
3036except ImportError as e :
31- if "no module named 'lora." not in str (e ):
37+ if not _can_ignore_error (e ):
3238 raise
3339
3440
You can’t perform that action at this time.
0 commit comments