diff --git a/presubmit_support.py b/presubmit_support.py index a9f80e272c..3bd79fdda8 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -12,6 +12,7 @@ __version__ = '1.8.0' # caching (between all different invocations of presubmit scripts for a given # change). We should add it as our presubmit scripts start feeling slow. +import ast # Exposed through the API. import cpplint import cPickle # Exposed through the API. import cStringIO # Exposed through the API. @@ -402,6 +403,7 @@ class InputApi(object): # We expose various modules and functions as attributes of the input_api # so that presubmit scripts don't have to import them. + self.ast = ast self.basename = os.path.basename self.cPickle = cPickle self.cpplint = cpplint diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index dc493028c9..00aeb64148 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -160,7 +160,7 @@ class PresubmitUnittest(PresubmitTestsBase): 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'main', 'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles', 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', - 'auth', 'cPickle', 'cpplint', 'cStringIO', 'contextlib', + 'ast', 'auth', 'cPickle', 'cpplint', 'cStringIO', 'contextlib', 'canned_check_filter', 'fix_encoding', 'fnmatch', 'gclient_utils', 'git_footers', 'glob', 'inspect', 'json', 'load_files', 'logging', 'marshal', 'normpath', 'optparse', 'os', 'owners', 'owners_finder', @@ -960,6 +960,7 @@ class InputApiUnittest(PresubmitTestsBase): 'ReadFile', 'RightHandSideLines', 'ShutdownPool', + 'ast', 'basename', 'cPickle', 'cpplint',