diff --git a/tensorflow/python/autograph/__init__.py b/tensorflow/python/autograph/__init__.py index 6faeb016072..8fd6e72da62 100644 --- a/tensorflow/python/autograph/__init__.py +++ b/tensorflow/python/autograph/__init__.py @@ -50,7 +50,7 @@ from tensorflow.python.autograph.lang.directives import set_element_type from tensorflow.python.autograph.lang.directives import set_loop_options from tensorflow.python.autograph.lang.special_functions import stack from tensorflow.python.autograph.lang.special_functions import tensor_list -from tensorflow.python.autograph.pyct.transformer import AutographParseError +from tensorflow.python.autograph.pyct.transformer import AutoGraphParseError from tensorflow.python.util.all_util import remove_undocumented # TODO(mdan): Revisit this list once we finalize the generated code mechanism. @@ -77,7 +77,7 @@ _allowed_symbols = [ 'stack', 'tensor_list', # Exceptions - 'AutographParseError', + 'AutoGraphParseError', # Utilities: to be removed 'utils', ] diff --git a/tensorflow/python/autograph/converters/control_flow_test.py b/tensorflow/python/autograph/converters/control_flow_test.py index 034fcbe3865..1a38d0db4d9 100644 --- a/tensorflow/python/autograph/converters/control_flow_test.py +++ b/tensorflow/python/autograph/converters/control_flow_test.py @@ -184,7 +184,7 @@ class ControlFlowTest(converter_testing.TestCase): return b node, ctx = self.prepare(test_fn, {}) - with self.assertRaises(transformer.AutographParseError): + with self.assertRaises(transformer.AutoGraphParseError): control_flow.transform(node, ctx) @test_util.run_deprecated_v1 diff --git a/tensorflow/python/autograph/converters/decorators_test.py b/tensorflow/python/autograph/converters/decorators_test.py index abd76849d6e..bcf502c62b3 100644 --- a/tensorflow/python/autograph/converters/decorators_test.py +++ b/tensorflow/python/autograph/converters/decorators_test.py @@ -121,7 +121,7 @@ class DecoratorsTest(converter_testing.TestCase): return inner_fn(a) # Expected to fail because simple_decorator could not be imported. - with self.assertRaises(transformer.AutographParseError): + with self.assertRaises(transformer.AutoGraphParseError): test_fn(1) def test_nested_decorators_imported(self): diff --git a/tensorflow/python/autograph/converters/slices_test.py b/tensorflow/python/autograph/converters/slices_test.py index bd049afdfce..d674f266c8c 100644 --- a/tensorflow/python/autograph/converters/slices_test.py +++ b/tensorflow/python/autograph/converters/slices_test.py @@ -68,7 +68,7 @@ class SliceTest(converter_testing.TestCase): def_.directives[directives.set_element_type] = { 'dtype': parser.parse_expression('tf.float32') } - with self.assertRaises(transformer.AutographParseError): + with self.assertRaises(transformer.AutoGraphParseError): slices.transform(node, ctx) diff --git a/tensorflow/python/autograph/pyct/transformer.py b/tensorflow/python/autograph/pyct/transformer.py index b6830534b3d..9c776a737aa 100644 --- a/tensorflow/python/autograph/pyct/transformer.py +++ b/tensorflow/python/autograph/pyct/transformer.py @@ -29,7 +29,7 @@ from tensorflow.python.autograph.pyct import pretty_printer from tensorflow.python.autograph.pyct import templates -class AutographParseError(SyntaxError): +class AutoGraphParseError(SyntaxError): pass @@ -495,8 +495,8 @@ class Base(gast.NodeTransformer): # In other words, we need to find how to suppress the "During handling # of the above exception, another exception occurred" message. six.reraise( - AutographParseError, - AutographParseError(msg, (original_file_path, original_line_number, + AutoGraphParseError, + AutoGraphParseError(msg, (original_file_path, original_line_number, original_col_offset, original_source_line)), sys.exc_info()[2]) finally: