| Conditions | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 10 | def get_implementation(override=None): |
||
| 11 | """ |
||
| 12 | Detect the active Python version and return a reference to the |
||
| 13 | module serving the version-specific pyclean implementation. |
||
| 14 | """ |
||
| 15 | implementation = dict( |
||
| 16 | CPython2='pyclean.py2clean', |
||
| 17 | CPython3='pyclean.py3clean', |
||
| 18 | PyPy2='pyclean.pypyclean', |
||
| 19 | PyPy3='pyclean.pypyclean', |
||
| 20 | ) |
||
| 21 | |||
| 22 | detected_version = '%s%s' % ( |
||
| 23 | platform.python_implementation(), |
||
| 24 | sys.version[0], |
||
| 25 | ) |
||
| 26 | |||
| 27 | module_name = implementation[override if override else detected_version] |
||
| 28 | return import_module(module_name) |
||
| 29 | |||
| 42 |