Given a list of range specifiers for python, ensure compatibility.
(specs)
| 89 | |
| 90 | |
| 91 | def ensure_python(specs): |
| 92 | """Given a list of range specifiers for python, ensure compatibility. |
| 93 | """ |
| 94 | if not isinstance(specs, (list, tuple)): |
| 95 | specs = [specs] |
| 96 | v = sys.version_info |
| 97 | part = '%s.%s' % (v.major, v.minor) |
| 98 | for spec in specs: |
| 99 | if part == spec: |
| 100 | return |
| 101 | try: |
| 102 | if eval(part + spec): |
| 103 | return |
| 104 | except SyntaxError: |
| 105 | pass |
| 106 | raise ValueError('Python version %s unsupported' % part) |
| 107 | |
| 108 | |
| 109 | def find_packages(top=HERE): |