# HG changeset patch # Parent ebec1a98ab81d19245e4bde2da03ccb489b9eb5f 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. diff -r ebec1a98ab81 Lib/test/test_gdb.py --- a/Lib/test/test_gdb.py Mon Nov 23 16:44:30 2015 +0200 +++ b/Lib/test/test_gdb.py Mon Dec 07 05:03:51 2015 +0000 @@ -75,6 +75,9 @@ 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)