File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
micropython/lora/lora/lora Expand file tree Collapse file tree 1 file changed +10
-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+ def _can_ignore_error (e ):
9+ """Check if ImportError can be ignored due to missing module."""
10+ return all (x in str (e ) for x in ["no module named" , "lora" ])
11+
812# Various lora "sub-packages"
913
1014try :
1115 from .sx126x import * # noqa: F401
1216
1317 ok = True
1418except ImportError as e :
15- if "no module named 'lora." not in str (e ):
19+ if not _can_ignore_error (e ):
1620 raise
1721
1822try :
1923 from .sx127x import * # noqa: F401
2024
2125 ok = True
2226except ImportError as e :
23- if "no module named 'lora." not in str (e ) and not ok :
27+ if not _can_ignore_error (e ):
2428 raise
2529
2630try :
2731 from .stm32wl5 import * # noqa: F401
2832
2933 ok = True
3034except ImportError as e :
31- if "no module named 'lora." not in str (e ) and not ok :
35+ if not _can_ignore_error (e ):
3236 raise
3337
3438
3842 )
3943
4044del ok
45+
46+
47+ __version__ = '0.2.1'
You can’t perform that action at this time.
0 commit comments