diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-01-18 19:16:02 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-01-18 19:16:02 +0100 |
commit | 4baf696c7156c9f300a33d9041bd677c574b6e14 (patch) | |
tree | 15d736254302f6b01260134a97f3bdfc04ff9738 /scripts/Expect.py | |
parent | Fixed bug introduced by previous commit (diff) | |
download | ice-4baf696c7156c9f300a33d9041bd677c574b6e14.tar.bz2 ice-4baf696c7156c9f300a33d9041bd677c574b6e14.tar.xz ice-4baf696c7156c9f300a33d9041bd677c574b6e14.zip |
Fixed ICE-2802 - no longer halt when running out of FDs
Diffstat (limited to 'scripts/Expect.py')
-rwxr-xr-x | scripts/Expect.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/Expect.py b/scripts/Expect.py index bf73f3d8850..7597364ccef 100755 --- a/scripts/Expect.py +++ b/scripts/Expect.py @@ -354,7 +354,8 @@ def signal_handler(signal, frame): #signal.signal(signal.SIGTERM, signal_handler) class Expect (object): - def __init__(self, command, startReader = True, timeout=30, logfile=None, mapping = None, desc = None, cwd = None, env = None): + def __init__(self, command, startReader=True, timeout=30, logfile=None, mapping=None, desc=None, cwd=None, env=None, + preexec_fn=None): self.buf = "" # The part before the match self.before = "" # The part before the match self.after = "" # The part after the match @@ -384,12 +385,13 @@ class Expect (object): # command. # CREATE_NEW_PROCESS_GROUP = 512 - self.p = subprocess.Popen(command, env = env, cwd = cwd, shell=False, bufsize=0, stdin=subprocess.PIPE, + self.p = subprocess.Popen(command, env=env, cwd=cwd, shell=False, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, creationflags = CREATE_NEW_PROCESS_GROUP, universal_newlines=True) else: - self.p = subprocess.Popen(splitCommand(command), env = env, cwd = cwd, shell=False, bufsize=0, - stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.p = subprocess.Popen(splitCommand(command), env=env, cwd=cwd, shell=False, bufsize=0, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + preexec_fn=preexec_fn) global processes processes[self.p.pid] = self.p |