(original) (raw)
changeset: 99919:8b8ac7adbf49 branch: 2.7 user: Martin Panter vadmium+py@gmail.com date: Sat Jan 16 05:07:35 2016 +0000 files: Lib/test/test_gdb.py description: 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 8b09d71fbb6b -r 8b8ac7adbf49 Lib/test/test_gdb.py --- a/Lib/test/test_gdb.py Sat Jan 16 04:32:52 2016 +0000 +++ b/Lib/test/test_gdb.py Sat Jan 16 05:07:35 2016 +0000 @@ -71,6 +71,8 @@ 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 /vadmium+py@gmail.com