expose temporary_directory.

Since python2 tempfile does not have TemporaryDirectory, we need to either use temporary_directory in gclient_utils or implement it by ourselves.  If we chose latter, we also need to implement rmtree for Windows.  Considering that, I suppose using gclient_utils should be much easier.

Bug: 939959
Change-Id: Ife21a2bc297ac61a4c1940b06df937c293961ae7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524815
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Auto-Submit: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
changes/15/1524815/5
Yoshisato Yanagisawa 6 years ago committed by Commit Bot
parent 4492c37a14
commit 57dd17b46e

@ -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')

@ -976,6 +976,7 @@ class InputApiUnittest(PresubmitTestsBase):
'subprocess',
'tbr',
'tempfile',
'temporary_directory',
'thread_pool',
'time',
'traceback',

Loading…
Cancel
Save