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

Unified Diff: git_cache.py

Issue 408653002: Git Cache speculative fix for windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Lint Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cache.py
diff --git a/git_cache.py b/git_cache.py
index ae8a5194878ac98f69bf0fcee1558fcec147837d..59bd48cbc0c22a03552e510c77df2fed00ae7195 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -406,7 +406,14 @@ class Mirror(object):
self._fetch(tempdir or self.mirror_path, verbose, depth)
finally:
if tempdir:
- os.rename(tempdir, self.mirror_path)
+ try:
+ os.rename(tempdir, self.mirror_path)
+ except OSError as e:
+ # This is somehow racy on Windows.
+ # Catching OSError because WindowsError isn't portable and
+ # pylint complains.
+ self.print('Error moving %s to %s: %s' % (tempdir, self.mirror_path,
+ str(e)))
if not ignore_lock:
lockfile.unlock()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698