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

Unified Diff: tools/telemetry/telemetry/core/platform/mac_platform_backend.py

Issue 163183003: [Telemetry] Small fixes to power monitoring (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/mac_platform_backend_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/mac_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
index 89fe7f3923ceb48adc000a7032ace6e01c37243d..b391e221bf68f33b9f02bbd13635da3e7915a9bc 100644
--- a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
@@ -80,7 +80,8 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
assert returncode in [0, -15], (
"powermetrics return code: %d" % returncode)
- return open(self._output_filename, 'rb').read()
tonyg 2014/02/13 15:30:37 Just for my knowledge, does this really leak? Or j
+ with open(self._output_filename, 'rb') as output_file:
+ return output_file.read()
finally:
shutil.rmtree(self._ouput_directory)
self._ouput_directory = None
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/mac_platform_backend_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698