Skip to content

Commit

Permalink
Merge pull request NixOS#222557 from alyssais/nixos-test-driver-scree…
Browse files Browse the repository at this point in the history
…nshot-charset

nixos/test-driver: accept non-\w* filenames
  • Loading branch information
tfc authored Mar 23, 2023
2 parents 0a528a3 + 27f9795 commit 09ad6a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nixos/lib/test-driver/test_driver/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,10 @@ def connect(self) -> None:
self.connected = True

def screenshot(self, filename: str) -> None:
word_pattern = re.compile(r"^\w+$")
if word_pattern.match(filename):
filename = os.path.join(self.out_dir, f"{filename}.png")
if "." not in filename:
filename += ".png"
if "/" not in filename:
filename = os.path.join(self.out_dir, filename)
tmp = f"{filename}.ppm"

with self.nested(
Expand Down

0 comments on commit 09ad6a7

Please sign in to comment.