diff options
author | 2018-07-31 08:43:25 -0700 | |
---|---|---|
committer | 2018-07-31 08:49:07 -0700 | |
commit | 5efec22b566d2ab656f83eb30858cfadac384c2c (patch) | |
tree | 10359e7aee0fb96f18c0b5339466567721a5bd92 | |
parent | 217dd20c5e945bafb1748f56a0cde079ced89764 (diff) |
Adding check to disable wrapping inner function bodies in try/except for error reporting until we can support this.
PiperOrigin-RevId: 206767387
-rw-r--r-- | tensorflow/contrib/autograph/converters/error_handlers.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/contrib/autograph/converters/error_handlers.py b/tensorflow/contrib/autograph/converters/error_handlers.py index 3f23662152..1936821394 100644 --- a/tensorflow/contrib/autograph/converters/error_handlers.py +++ b/tensorflow/contrib/autograph/converters/error_handlers.py @@ -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 |