Conditions | 3 |
Total Lines | 14 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """ |
||
36 | def _import(paths: List[Path]) -> List[Module]: |
||
37 | # Import the given list of paths and return the Module instances of the |
||
38 | # successfully imported modules. |
||
39 | result = [] |
||
40 | for p in paths: |
||
41 | path_to_module = p.resolve().parent |
||
42 | sys.path.insert(0, str(path_to_module)) |
||
43 | module_name = p.stem |
||
44 | try: |
||
45 | module = import_module(module_name) |
||
46 | result.append(module) |
||
47 | except ImportError: |
||
48 | pass |
||
49 | return result |
||
50 |