Adding check to disable wrapping inner function bodies in try/except for error reporting until we can support this.

PiperOrigin-RevId: 206767387
This commit is contained in:
A. Unique TensorFlower 2018-07-31 08:43:25 -07:00 committed by TensorFlower Gardener
parent 217dd20c5e
commit 5efec22b56

View File

@ -37,7 +37,8 @@ class ErrorRewritingTransformer(converter.Base):
def visit_FunctionDef(self, node):
node = self.generic_visit(node)
if anno.hasanno(node, anno.Basic.ORIGIN):
if (anno.hasanno(node, anno.Basic.ORIGIN) and
len(self.enclosing_entities) <= 1):
template = """
try:
body