| 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()
|
|
|
|
|