summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-01-16 05:07:35 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-01-16 05:07:35 (GMT)
commit2179b2e15968df087d81d57ed806dcfe6140b843 (patch)
tree0fdbdc7d98b2f450983bb98458ff6cb973d7c084
parent264dcb729082579611de27680df701e763895298 (diff)
downloadcpython-2179b2e15968df087d81d57ed806dcfe6140b843.zip
cpython-2179b2e15968df087d81d57ed806dcfe6140b843.tar.gz
cpython-2179b2e15968df087d81d57ed806dcfe6140b843.tar.bz2
Issue #14771: Redirect GDB's stdin to avoid messing the terminal settings
Otherwise, GDB seems to affect the terminal's foreground process group, interfering with test_ioctl, which does not expect the foreground process to change during the test. This change also solves the problem of the tests being stopped in the shell if test_gdb is run twice in parallel.
-rw-r--r--Lib/test/test_gdb.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 8a56118..f157eae 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -71,6 +71,8 @@ def run_gdb(*args, **env_vars):
if (gdb_major_version, gdb_minor_version) >= (7, 4):
base_cmd += ('-iex', 'add-auto-load-safe-path ' + checkout_hook_path)
out, err = subprocess.Popen(base_cmd + args,
+ # Redirect stdin to prevent GDB from messing with terminal settings
+ stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env,
).communicate()
return out, err