Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2814)

Unified Diff: build/android/devil/utils/tempdir.py

Issue 1415533007: [Android] Add sharding for AMP instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed rnephew's comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/devil/utils/tempdir.py
diff --git a/build/android/devil/utils/tempdir.py b/build/android/devil/utils/tempdir.py
new file mode 100644
index 0000000000000000000000000000000000000000..2566c00c274c5f1203e4e155cac5758aebd9ccde
--- /dev/null
+++ b/build/android/devil/utils/tempdir.py
@@ -0,0 +1,15 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import contextlib
+import tempfile
+import shutil
+
+@contextlib.contextmanager
+def TempDir(suffix='', prefix=''):
jbudorick 2015/11/17 18:04:46 this, like tempfile, should provide a delete=True
mikecase (-- gone --) 2015/11/19 01:35:37 Done
+ dirname = tempfile.mkdtemp(suffix=suffix, prefix=prefix)
+ try:
+ yield dirname
+ finally:
+ shutil.rmtree(dirname)

Powered by Google App Engine
This is Rietveld 408576698