diff --git a/presubmit_support.py b/presubmit_support.py index 987b4c3aa..d560cec8e 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -518,6 +518,9 @@ class InputApi(object): self.cStringIO = cStringIO self.fnmatch = fnmatch self.gclient_paths = gclient_paths + # TODO(yyanagisawa): stop exposing this when python3 become default. + # Since python3's tempfile has TemporaryDirectory, we do not need this. + self.temporary_directory = gclient_utils.temporary_directory self.glob = glob.glob self.json = json self.logging = logging.getLogger('PRESUBMIT') diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index de5a04fbd..ccc7ed278 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -976,6 +976,7 @@ class InputApiUnittest(PresubmitTestsBase): 'subprocess', 'tbr', 'tempfile', + 'temporary_directory', 'thread_pool', 'time', 'traceback',