From a1532717be531a75267a34c62566805aa68abf4e Mon Sep 17 00:00:00 2001 From: Yunxing Dai Date: Fri, 23 Nov 2018 14:05:07 -0800 Subject: [PATCH] Automated rollback of commit 89deaf06c19a3eb1d5236d328b6b8cdde7238271 PiperOrigin-RevId: 222644654 --- tensorflow/compiler/tests/xla_test.py | 5 ----- tensorflow/python/platform/googletest.py | 9 +-------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/tensorflow/compiler/tests/xla_test.py b/tensorflow/compiler/tests/xla_test.py index d15c073457b..98a41981cf3 100644 --- a/tensorflow/compiler/tests/xla_test.py +++ b/tensorflow/compiler/tests/xla_test.py @@ -22,7 +22,6 @@ import contextlib import os import random import re -import sys import numpy as np @@ -39,10 +38,6 @@ from tensorflow.python.platform import flags from tensorflow.python.platform import test from tensorflow.python.platform import tf_logging as logging -# TODO(b/35678764): Disable monkeypatched exit handlers once we find a proper -# solution to invoke exit handlers during program exit. -test._googletest.SetOSExit(sys.exit) - FLAGS = flags.FLAGS flags.DEFINE_string('test_device', None, diff --git a/tensorflow/python/platform/googletest.py b/tensorflow/python/platform/googletest.py index c8312c153e0..8141cf92c56 100644 --- a/tensorflow/python/platform/googletest.py +++ b/tensorflow/python/platform/googletest.py @@ -47,13 +47,6 @@ unittest_main = main # directory only once per test binary invocation. _googletest_temp_dir = '' -_os_exit = sys.exit - - -def SetOSExit(exit_func): - global _os_exit - _os_exit = exit_func - # pylint: disable=invalid-name # pylint: disable=undefined-variable @@ -68,7 +61,7 @@ def g_main(argv): except IOError: sys.stderr.write('Error opening TEST_SHARD_STATUS_FILE (%s). Exiting.' % os.environ['TEST_SHARD_STATUS_FILE']) - _os_exit(1) + sys.exit(1) finally: if f is not None: f.close()