|
34 | 34 |
|
35 | 35 | implementation = platform.python_implementation()
|
36 | 36 | if implementation != "CPython":
|
37 |
| - sys.exit("whats_left.py must be run under CPython, got {implementation} instead") |
38 |
| - |
| 37 | + sys.exit(f"whats_left.py must be run under CPython, got {implementation} instead") |
| 38 | +if sys.version_info[:2] < (3, 11): |
| 39 | + sys.exit(f"whats_left.py must be run under CPython 3.11 or newer, got {implementation} {sys.version} instead") |
39 | 40 |
|
40 | 41 | def parse_args():
|
41 | 42 | parser = argparse.ArgumentParser(description="Process some integers.")
|
@@ -483,11 +484,17 @@ def remove_one_indent(s):
|
483 | 484 | if args.signature:
|
484 | 485 | print("\n# mismatching signatures (warnings)")
|
485 | 486 | for modname, mismatched in result["mismatched_items"].items():
|
486 |
| - for (item, rustpy_value, cpython_value) in mismatched: |
487 |
| - if cpython_value == "ValueError('no signature found')": |
488 |
| - continue # these items will never match |
489 |
| - |
490 |
| - print(f"{item} {rustpy_value} != {cpython_value}") |
| 487 | + for i, (item, rustpy_value, cpython_value) in enumerate(mismatched): |
| 488 | + if cpython_value and cpython_value.startswith("ValueError("): |
| 489 | + continue # these items will never match |
| 490 | + if rustpy_value is None or rustpy_value.startswith("ValueError("): |
| 491 | + rustpy_value = f" {rustpy_value}" |
| 492 | + print(f"{item}{rustpy_value}") |
| 493 | + if cpython_value is None: |
| 494 | + cpython_value = f" {cpython_value}" |
| 495 | + print(f"{' ' * len(item)}{cpython_value}") |
| 496 | + if i < len(mismatched) - 1: |
| 497 | + print() |
491 | 498 |
|
492 | 499 | if args.doc:
|
493 | 500 | print("\n# mismatching `__doc__`s (warnings)")
|
|
0 commit comments