(cargo)
| 1500 | return 0 |
| 1501 | |
| 1502 | def get_cargo_version(cargo): |
| 1503 | try: |
| 1504 | proc = subprocess.Popen(shlex.split(cargo) + ['--version'], |
| 1505 | stdin=subprocess.PIPE, stderr=subprocess.PIPE, |
| 1506 | stdout=subprocess.PIPE) |
| 1507 | except OSError: |
| 1508 | return '0.0' |
| 1509 | |
| 1510 | with proc: |
| 1511 | cargo_ret = to_utf8(proc.communicate()[0]) |
| 1512 | |
| 1513 | match = re.match(r"cargo ([0-9]+\.[0-9]+\.[0-9]+)", cargo_ret) |
| 1514 | |
| 1515 | if match: |
| 1516 | return match.group(1) |
| 1517 | |
| 1518 | warn(f'Could not recognize `cargo`: {cargo_ret}') |
| 1519 | return '0.0' |
| 1520 | |
| 1521 | def get_rustc_version(rustc): |
| 1522 | try: |
no test coverage detected
searching dependent graphs…