diff --git a/share/machdeps/make_machdep/make_machdep.py b/share/machdeps/make_machdep/make_machdep.py
index 6eb4fa52bb10df7ba1f0679d4e2fbb996bc86efe..5382fcfd39e5fd6cb5ce5869958653a72a2dc173 100755
--- a/share/machdeps/make_machdep/make_machdep.py
+++ b/share/machdeps/make_machdep/make_machdep.py
@@ -40,7 +40,6 @@ by hand afterwards.
 
 import argparse
 import yaml
-import json
 from pathlib import Path
 import re
 import subprocess
@@ -121,9 +120,6 @@ def check_machdep(machdep):
     except ImportError:
         warnings.warn("jsonschema is not available: no validation will be performed")
         return True
-    except OSError:
-        warnings.warn(f"error opening {schema_filename}: no validation will be performed")
-        return True
     except ValidationError:
         warnings.warn("machdep object is not conforming to machdep schema")
         return False
@@ -392,7 +388,7 @@ if proc.returncode == 0:
         lines += f"{line.strip()}\n"
     machdep["custom_defs"] = custom_defs(lines)
 else:
-    warnings.warn(f"could not determine predefined macros")
+    warnings.warn("could not determine predefined macros")
     if args.verbose:
         print(f"compiler output is:{proc.stderr}")