mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Andrew Kaster
parent
fbc941d4f4
commit
199f0e45cb
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user