try given list of modules and return that imports
(names)
| 18 | |
| 19 | |
| 20 | def detect_java_comm(names): |
| 21 | """try given list of modules and return that imports""" |
| 22 | for name in names: |
| 23 | try: |
| 24 | mod = my_import(name) |
| 25 | mod.SerialPort |
| 26 | return mod |
| 27 | except (ImportError, AttributeError): |
| 28 | pass |
| 29 | raise ImportError("No Java Communications API implementation found") |
| 30 | |
| 31 | |
| 32 | # Java Communications API implementations |
no test coverage detected