| Conditions | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python3 |
||
| 35 | 5 | def where_which(path): |
|
| 36 | """ |
||
| 37 | Backwards compatibility wrapper for approximating which/where. |
||
| 38 | |||
| 39 | :param path: Path to a file. |
||
| 40 | :type path: str |
||
| 41 | """ |
||
| 42 | 5 | try: |
|
| 43 | 5 | from shutil import which |
|
| 44 | 1 | except ImportError: # 3.2 |
|
| 45 | 1 | from shutilwhich import which |
|
| 46 | finally: |
||
| 47 | 5 | thepath = which(path) |
|
| 48 | return thepath |
||
| 49 |