fixes for py3.7 builds

PiperOrigin-RevId: 235128104
This commit is contained in:
A. Unique TensorFlower 2019-02-21 21:17:05 -08:00 committed by TensorFlower Gardener
parent 5295cfc096
commit 2b8badc120
2 changed files with 6 additions and 3 deletions

View File

@ -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,

View File

@ -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(