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

Unified Diff: build/android/pylib/utils/device_temp_file.py

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « build/android/pylib/uirobot/uirobot_test_instance.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/device_temp_file.py
diff --git a/build/android/pylib/utils/device_temp_file.py b/build/android/pylib/utils/device_temp_file.py
index e84db695eecfda1ef1562e466e3a2a19f9e9770f..7d3b95b10464263c1abb9f79f4f5e90322b741b6 100644
--- a/build/android/pylib/utils/device_temp_file.py
+++ b/build/android/pylib/utils/device_temp_file.py
@@ -43,8 +43,12 @@ class DeviceTempFile(object):
def close(self):
"""Deletes the temporary file from the device."""
- # we use -f to ignore errors if the file is already gone
- self._adb.Shell('rm -f %s' % self.name_quoted)
+ # ignore exception if the file is already gone.
+ try:
+ self._adb.Shell('rm -f %s' % self.name_quoted)
+ except device_errors.AdbCommandFailedError:
+ # file does not exist on Android version without 'rm -f' support (ICS)
+ pass
def __enter__(self):
return self
« no previous file with comments | « build/android/pylib/uirobot/uirobot_test_instance.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698