diff --git a/tensorflow/python/eager/tensor_test.py b/tensorflow/python/eager/tensor_test.py index 0d8845bd96f..23fb983767b 100644 --- a/tensorflow/python/eager/tensor_test.py +++ b/tensorflow/python/eager/tensor_test.py @@ -66,11 +66,11 @@ class TFETensorTest(test_util.TensorFlowTestCase): device = ctx.device_name # Missing context. with self.assertRaisesRegexp( - TypeError, r"Required argument 'context' \(pos 2\) not found"): + TypeError, r".*argument 'context' \(pos 2\).*"): ops.EagerTensor(1, device=device) # Missing device. with self.assertRaisesRegexp( - TypeError, r"Required argument 'device' \(pos 3\) not found"): + TypeError, r".*argument 'device' \(pos 3\).*"): ops.EagerTensor(1, context=handle) # Bad dtype type. with self.assertRaisesRegexp(TypeError, diff --git a/tensorflow/tools/docs/parser.py b/tensorflow/tools/docs/parser.py index ff32d089514..d87f9585f20 100644 --- a/tensorflow/tools/docs/parser.py +++ b/tensorflow/tools/docs/parser.py @@ -502,7 +502,10 @@ def _gen_pairs(items): assert len(items) % 2 == 0 items = iter(items) while True: - yield next(items), next(items) + try: + yield next(items), next(items) + except StopIteration: + return class _FunctionDetail(