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

Unified Diff: client/utils/tools.py

Issue 1932143003: run_isolated: support non-isolated commands (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@run-isolated-download-stats
Patch Set: rebased Created 4 years, 8 months 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
« client/run_isolated.py ('K') | « client/tests/run_isolated_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/utils/tools.py
diff --git a/client/utils/tools.py b/client/utils/tools.py
index 506143d7e3310b2ba5f6d275da251ed9182db8e7..9889797079f2efb49f97f3a9c6492fa4eca9a874 100644
--- a/client/utils/tools.py
+++ b/client/utils/tools.py
@@ -5,6 +5,7 @@
"""Various utility functions and classes not specific to any single area."""
import atexit
+import contextlib
import cStringIO
import functools
import json
@@ -316,3 +317,9 @@ def get_cacerts_bundle():
# to current directory instead. We use our own bundled copy of cacert.pem.
_ca_certs = zip_package.extract_resource(utils, 'cacert.pem', temp_dir='.')
return _ca_certs
+
+
+@contextlib.contextmanager
+def noop_context():
+ """A noop context, can be used with `with` keyword."""
+ yield
« client/run_isolated.py ('K') | « client/tests/run_isolated_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698