tests/hghave.py
changeset 52547 918ef1fca39e
parent 52546 384d71e3dd65
child 52640 24ee91ba9aa8
--- a/tests/hghave.py	Tue Dec 17 22:54:36 2024 -0500
+++ b/tests/hghave.py	Fri Dec 27 19:58:57 2024 -0500
@@ -1142,12 +1142,16 @@
     if 'RUNTESTDIR' in env:
         cwd = os.path.realpath(f"{env['RUNTESTDIR']}/..")
 
-    p = subprocess.Popen(
-        ['black', '--check', '-'],
-        stdin=subprocess.PIPE,
-        cwd=cwd,
-        env=env,
-    )
+    try:
+        p = subprocess.Popen(
+            ['black', '--check', '-'],
+            stdin=subprocess.PIPE,
+            cwd=cwd,
+            env=env,
+        )
+    except FileNotFoundError:
+        return False
+
     p.communicate(b'# test\n')
     return p.returncode == 0