diff options
| author | bors <bors@rust-lang.org> | 2020-12-30 21:25:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-30 21:25:15 +0000 |
| commit | 9775ffef2a4c3a36cadb58b72ea60cefb92c86ae (patch) | |
| tree | 3cd62fcea1d36df812c14eec010c884c466deb8b /src/bootstrap | |
| parent | e2267046859c9ceb932abc983561d53a117089f6 (diff) | |
| parent | 8998e31223333cdcf384cf39876d7c4bb533db48 (diff) | |
| download | rust-9775ffef2a4c3a36cadb58b72ea60cefb92c86ae.tar.gz rust-9775ffef2a4c3a36cadb58b72ea60cefb92c86ae.zip | |
Auto merge of #80530 - m-ou-se:rollup-zit69ko, r=m-ou-se
Rollup of 9 pull requests Successful merges: - #78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength) - #79479 (Add `Iterator::intersperse`) - #80128 (Edit rustc_ast::ast::FieldPat docs) - #80424 (Don't give an error when creating a file for the first time) - #80458 (Some Promotion Refactoring) - #80488 (Do not create dangling &T in Weak<T>::drop) - #80491 (Miri: make size/align_of_val work for dangling raw ptrs) - #80495 (Rename kw::Invalid -> kw::Empty) - #80513 (Add regression test for #80062) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 97f40815b87..b8bae69d063 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -351,11 +351,13 @@ def output(filepath): with open(tmp, 'w') as f: yield f try: - os.remove(filepath) # PermissionError/OSError on Win32 if in use - os.rename(tmp, filepath) + if os.path.exists(filepath): + os.remove(filepath) # PermissionError/OSError on Win32 if in use except OSError: shutil.copy2(tmp, filepath) os.remove(tmp) + return + os.rename(tmp, filepath) class RustBuild(object): |
