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 |