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

Unified Diff: client/third_party/infra_libs/utils.py

Issue 2708113002: Revert of Add field_specs to all metrics in luci-py (Closed)
Patch Set: Created 3 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 | « client/third_party/infra_libs/ts_mon/config.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/third_party/infra_libs/utils.py
diff --git a/client/third_party/infra_libs/utils.py b/client/third_party/infra_libs/utils.py
index c975c5fef2500670e3e136eb1a24f8104838404c..8c49d3e7cff5fb6840e8d6103562abe4b0cd24ae 100644
--- a/client/third_party/infra_libs/utils.py
+++ b/client/third_party/infra_libs/utils.py
@@ -75,27 +75,14 @@
if not os.path.exists(file_path):
return
- if os.path.isfile(file_path):
- for i in xrange(3):
- try:
- os.remove(file_path)
- return
- except OSError:
- if i == 2:
- raise
- time.sleep(3)
-
if sys.platform == 'win32':
# Give up and use cmd.exe's rd command.
file_path = os.path.normcase(file_path)
- for i in xrange(3):
- try:
- subprocess.check_call(['cmd.exe', '/c', 'rd', '/q', '/s', file_path])
- return
- except subprocess.CalledProcessError:
- if i == 2:
- raise
- time.sleep(3)
+ for _ in xrange(3):
+ if not subprocess.call(['cmd.exe', '/c', 'rd', '/q', '/s', file_path]):
+ break
+ time.sleep(3)
+ return
def remove_with_retry(rmfunc, path):
if os.path.islink(path):
« no previous file with comments | « client/third_party/infra_libs/ts_mon/config.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698