mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Meta: Make download_file
work on Windows
The file is not committed to disk until the close which occurs at the termination of the scope. Extract the `rename` to outside the scope allowing this to work on Windows. The `download_file` utility downloads a file in the `gn` build.
This commit is contained in:
parent
fbc941d4f4
commit
199f0e45cb
Notes:
github-actions[bot]
2024-09-25 16:20:35 +00:00
Author: https://github.com/compnerd 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/199f0e45cb9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1518
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ def main():
|
|||
try:
|
||||
with tempfile.NamedTemporaryFile(delete=False, dir=output_file.parent) as out:
|
||||
out.write(f.read())
|
||||
os.rename(out.name, output_file)
|
||||
os.rename(out.name, output_file)
|
||||
except IOError:
|
||||
os.unlink(out.name)
|
||||
|
||||
|
|
Loading…
Reference in a new issue