Conditions | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | #!/usr/bin/env python3 |
||
22 | 5 | def where_which(path): |
|
23 | """ |
||
24 | Backwards compatibility wrapper for approximating which/where. |
||
25 | |||
26 | :param path: Path to a file. |
||
27 | :type path: str |
||
28 | """ |
||
29 | 5 | try: |
|
30 | 5 | from shutil import which |
|
31 | 1 | except ImportError: |
|
32 | 1 | from shutilwhich import which |
|
33 | finally: |
||
34 | 5 | thepath = which(path) |
|
35 | return thepath |
||
36 |