Skip to content

Commit 207f9df

Browse files
committed
Only import 'pty' after checking that we're not on Windows
1 parent 46e5ab5 commit 207f9df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testsuite/drivers/base_driver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import glob
33
import os
44
import os.path as P
5-
import pty
65
import re
76
import select
87
import subprocess
@@ -288,6 +287,10 @@ def run_in_tty(self, args: list[str], **kwargs) -> tuple[str, int]:
288287
"Cannot run a pseudo-TTY on Windows systems"
289288
)
290289

290+
# Only import ``pty`` after checking that we are not on a Windows
291+
# system.
292+
import pty
293+
291294
# Ensure the process is run in the testsuite working dir
292295
if not kwargs.get("cwd"):
293296
kwargs["cwd"] = self.working_dir()

0 commit comments

Comments
 (0)