|
13 | 13 | # |
14 | 14 | # Authors: |
15 | 15 | # Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> |
16 | | - |
17 | | -# Disable this for the file, because pylint is not picking it up |
18 | | -# when specifying it on the specific line. |
19 | | -# |
20 | | -# pylint: disable=subprocess-popen-preexec-fn |
21 | | -# |
22 | 16 | """ |
23 | 17 | Utilities |
24 | 18 | ========= |
@@ -1260,14 +1254,7 @@ def _call(*popenargs, terminate=False, **kwargs): |
1260 | 1254 |
|
1261 | 1255 | process = None |
1262 | 1256 |
|
1263 | | - old_preexec_fn = kwargs.get("preexec_fn") |
1264 | | - if "preexec_fn" in kwargs: |
1265 | | - del kwargs["preexec_fn"] |
1266 | | - |
1267 | | - def preexec_fn(): |
1268 | | - os.umask(stat.S_IWGRP | stat.S_IWOTH) |
1269 | | - if old_preexec_fn is not None: |
1270 | | - old_preexec_fn() |
| 1257 | + kwargs["umask"] = stat.S_IWGRP | stat.S_IWOTH |
1271 | 1258 |
|
1272 | 1259 | # Handle termination, suspend and resume |
1273 | 1260 | def kill_proc(): |
@@ -1313,7 +1300,7 @@ def resume_proc(): |
1313 | 1300 | os.killpg(group_id, signal.SIGCONT) |
1314 | 1301 |
|
1315 | 1302 | with _signals.suspendable(suspend_proc, resume_proc), _signals.terminator(kill_proc), subprocess.Popen( |
1316 | | - *popenargs, preexec_fn=preexec_fn, universal_newlines=True, **kwargs |
| 1303 | + *popenargs, universal_newlines=True, **kwargs |
1317 | 1304 | ) as process: |
1318 | 1305 | # Here, we don't use `process.communicate()` directly without a timeout |
1319 | 1306 | # This is because, if we were to do that, and the process would never |
|
0 commit comments