summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-01-16 05:18:47 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-01-16 05:18:47 (GMT)
commit7a5fe6d5d11ac1d86f49576d79506642f108edd5 (patch)
treef800a9991d19df1596071dc2e1561f287a4a7bb2
parent20b1bfa6fb609e91343dfdd454841f50d6d5e140 (diff)
downloadcpython-7a5fe6d5d11ac1d86f49576d79506642f108edd5.zip
cpython-7a5fe6d5d11ac1d86f49576d79506642f108edd5.tar.gz
cpython-7a5fe6d5d11ac1d86f49576d79506642f108edd5.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.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 16fb389..78fc55c 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -75,6 +75,9 @@ 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)
proc = subprocess.Popen(base_cmd + args,
+ # Redirect stdin to prevent GDB from messing with
+ # the terminal settings
+ stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env)