From 86fcf0641098b72715abaa59637c4a6025e27708 Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Sun, 24 Nov 2019 20:16:06 +0100 Subject: [PATCH] [CLN][REM] remove unused codes of unused platforms. --- wexpect.py | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/wexpect.py b/wexpect.py index bdde792..42e7f77 100644 --- a/wexpect.py +++ b/wexpect.py @@ -315,12 +315,9 @@ def spawn(command, args=[], timeout=30, maxread=2000, searchwindowsize=None, log log('\t%s=%s' % (name, env[name])) if cwd: log('Working directory: %s' % cwd) - if sys.platform == 'win32': - return spawn_windows(command, args, timeout, maxread, searchwindowsize, logfile, cwd, env, - codepage) - else: - return spawn_unix(command, args, timeout, maxread, searchwindowsize, logfile, cwd, env) + return spawn_windows(command, args, timeout, maxread, searchwindowsize, logfile, cwd, env, + codepage) class spawn_windows (): """This is the main class interface for Pexpect. Use this class to start @@ -438,10 +435,6 @@ class spawn_windows (): self.codepage = codepage - if sys.platform != 'win32': - self.STDIN_FILENO = pty.STDIN_FILENO - self.STDOUT_FILENO = pty.STDOUT_FILENO - self.STDERR_FILENO = pty.STDERR_FILENO self.stdin = sys.stdin self.stdout = sys.stdout self.stderr = sys.stderr @@ -478,14 +471,7 @@ class spawn_windows (): self.ocwd = os.getcwd() self.cwd = cwd self.env = env - self.__irix_hack = (sys.platform.lower().find('irix')>=0) # This flags if we are running on irix - # Solaris uses internal __fork_pty(). All others use pty.fork(). - if (sys.platform.lower().find('solaris')>=0) or (sys.platform.lower().find('sunos5')>=0): - self.use_native_pty_fork = False - else: - self.use_native_pty_fork = True - - + # allow dummy instances for subclasses that may not use command or args. if command is None: self.command = None @@ -494,10 +480,6 @@ class spawn_windows (): else: self._spawn (command, args) - #__irix_hack set by super, windows doesn't need it. - self.__irix_hack = None - - def __del__(self): """This makes sure that no system resources are left open. Python only garbage collects Python objects, not the child console."""