diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-04-16 18:20:44 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-04-16 18:20:44 +0900 |
commit | 31f983c4bfce2b412a9fb9410efae6b9ece7bb20 (patch) | |
tree | d44bf7dddd10687a6b1c6c27000c4a9ef5c27635 | |
parent | 599485fc7633ec22c2645b97648fd4454d5f8636 (diff) | |
download | buildstream-31f983c4bfce2b412a9fb9410efae6b9ece7bb20.tar.gz |
plugins/sources/git.py: Cope with rename returning error EEXIST
Thanks to Matthew Yates for pointing this out.
-rw-r--r-- | buildstream/plugins/sources/git.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py index 0ff46803f..9ecef445b 100644 --- a/buildstream/plugins/sources/git.py +++ b/buildstream/plugins/sources/git.py @@ -128,9 +128,9 @@ class GitMirror(SourceFetcher): except OSError as e: # When renaming and the destination repo already exists, os.rename() - # will fail with ENOTEMPTY, since an empty directory will be silently - # replaced - if e.errno == errno.ENOTEMPTY: + # will fail with ENOTEMPTY or EEXIST, since an empty directory will + # be silently replaced + if e.errno in (errno.ENOTEMPTY, errno.EEXIST): self.source.status("{}: Discarding duplicate clone of {}" .format(self.source, url)) else: |