nixos/lib/test-driver: correct regex in pythonize_name()

r"[A-z]" is not equivalent to r"[A-Za-z]"; it is equivalent to r"[A-Z[]^_`a-z]".
But Python variable names cannot contain, e.g., a backtick.
So the current regex is wrong.
This commit is contained in:
Michael Daniels 2025-07-06 20:14:21 -04:00
parent 5c724ed138
commit 98b97a2011
No known key found for this signature in database

View File

@ -53,7 +53,7 @@ def get_tmp_dir() -> Path:
def pythonize_name(name: str) -> str:
return re.sub(r"^[^A-z_]|[^A-z0-9_]", "_", name)
return re.sub(r"^[^A-Za-z_]|[^A-Za-z0-9_]", "_", name)
class Driver: