| 1 |
|
| 2 |
"""The support utility must start on the suite's supported Python.""" |
| 3 |
|
| 4 |
import os |
| 5 |
import subprocess |
| 6 |
import sys |
| 7 |
from pathlib import Path |
| 8 |
|
| 9 |
|
| 10 |
source_dir = Path(os.environ.get("srcdir", Path(__file__).resolve().parents[1])) |
| 11 |
script = source_dir / "support" / "git-set-file-times" |
| 12 |
proc = subprocess.run( |
| 13 |
[sys.executable, str(script), "--help"], |
| 14 |
stdout=subprocess.PIPE, |
| 15 |
stderr=subprocess.PIPE, |
| 16 |
text=True, |
| 17 |
) |
| 18 |
|
| 19 |
if proc.returncode != 0: |
| 20 |
sys.stderr.write(proc.stdout) |
| 21 |
sys.stderr.write(proc.stderr) |
| 22 |
sys.stderr.write( |
| 23 |
"git-set-file-times did not start with Python %s\n" |
| 24 |
% ".".join(str(value) for value in sys.version_info[:3]) |
| 25 |
) |
| 26 |
raise SystemExit(1) |
| 27 |
|
| 28 |
if "usage: git-set-file-times" not in proc.stdout: |
| 29 |
sys.stderr.write("git-set-file-times --help did not print its usage\n") |
| 30 |
raise SystemExit(1) |