Finds the highest supported pickle protocol for a given Python version. Args: py_version: a 2-tuple of the major, minor version. Eg. Python 3.7 would be (3, 7) Returns: int for the highest supported pickle protocol
(py_version)
| 33 | } |
| 34 | |
| 35 | def highest_proto_for_py_version(py_version): |
| 36 | """Finds the highest supported pickle protocol for a given Python version. |
| 37 | Args: |
| 38 | py_version: a 2-tuple of the major, minor version. Eg. Python 3.7 would |
| 39 | be (3, 7) |
| 40 | Returns: |
| 41 | int for the highest supported pickle protocol |
| 42 | """ |
| 43 | proto = 2 |
| 44 | for p, v in protocols_map.items(): |
| 45 | if py_version < v: |
| 46 | break |
| 47 | proto = p |
| 48 | return proto |
| 49 | |
| 50 | def have_python_version(py_version): |
| 51 | """Check whether a Python binary exists for the given py_version and has |
no test coverage detected
searching dependent graphs…