From 2b8badc120ce8f852fb5a4cc5d646e38c54b6b3c Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 21 Feb 2019 21:17:05 -0800 Subject: [PATCH] fixes for py3.7 builds PiperOrigin-RevId: 235128104 --- tensorflow/python/eager/tensor_test.py | 4 ++-- tensorflow/tools/docs/parser.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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(