aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/platform
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-01-29 14:40:07 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-29 14:45:38 -0800
commita807755db184c2d2c3b9bcca65457e9915508650 (patch)
tree18c9af403740672f327f7df28b4e3f9e044ea57e /tensorflow/python/platform
parentc7351055a89b90c3114fb4c24f880a947a15352e (diff)
Use Popen.communicate() instead of read() in stacktrace_handler_test.py.
This avoids potential deadlock, see the warnings in https://docs.python.org/2/library/subprocess.html#popen-objects. I found that enabling the C API caused us to deadlock without this change. PiperOrigin-RevId: 183730170
Diffstat (limited to 'tensorflow/python/platform')
-rw-r--r--tensorflow/python/platform/stacktrace_handler_test.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/platform/stacktrace_handler_test.py b/tensorflow/python/platform/stacktrace_handler_test.py
index 3f0e534f4c..f2071f9d54 100644
--- a/tensorflow/python/platform/stacktrace_handler_test.py
+++ b/tensorflow/python/platform/stacktrace_handler_test.py
@@ -57,7 +57,8 @@ class StacktraceHandlerTest(test.TestCase):
# Capture its output. capture both stdout and stderr and append them.
# We are not worried about timing or order of messages in this test.
- child_output = child_process.stdout.read() + child_process.stderr.read()
+ child_stdout, child_stderr = child_process.communicate()
+ child_output = child_stdout + child_stderr
# Make sure the child process is dead before we proceed.
child_process.wait()