| Conditions | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env python3 |
||
| 22 | 4 | 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 | 4 | try: |
|
| 30 | 4 | from shutil import which |
|
| 31 | 1 | except ImportError: |
|
| 32 | 1 | from shutilwhich import which |
|
| 33 | finally: |
||
| 34 | 4 | thepath = which(path) |
|
| 35 | return thepath |
||
| 36 |