Skip to content

Commit 2113498

Browse files
committed
Update code to use newer subprocess features.
1 parent 9550ac2 commit 2113498

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/robot/libraries/Process.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -994,16 +994,12 @@ def popen_config(self):
994994
'shell': self.shell,
995995
'cwd': self.cwd,
996996
'env': self.env}
997-
# Close file descriptors regardless the Python version:
998-
# https://github.com/robotframework/robotframework/issues/2794
999-
if not WINDOWS:
1000-
config['close_fds'] = True
1001997
self._add_process_group_config(config)
1002998
return config
1003999

10041000
def _add_process_group_config(self, config):
10051001
if hasattr(os, 'setsid'):
1006-
config['preexec_fn'] = os.setsid
1002+
config['start_new_session'] = True
10071003
if hasattr(subprocess, 'CREATE_NEW_PROCESS_GROUP'):
10081004
config['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
10091005

0 commit comments

Comments
 (0)