[lldb] [test] Delay pty/tty imports to fix Windows builds

Delay pty/tty module imports until they are actually used, in order
to prevent their import failures on Windows.
This commit is contained in:
Michał Górny 2021-10-01 15:24:49 +02:00
parent dfb213c2df
commit 12ee4c9ad8
1 changed files with 2 additions and 2 deletions

View File

@ -3,10 +3,8 @@ import errno
import io
import os
import os.path
import pty
import threading
import socket
import tty
import lldb
import binascii
import traceback
@ -409,6 +407,8 @@ class TCPServerSocket(ServerSocket):
class PtyServerSocket(ServerSocket):
def __init__(self):
import pty
import tty
master, slave = pty.openpty()
tty.setraw(master)
self._master = io.FileIO(master, 'r+b')