mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
forgejo/inject-pr-samples: properly flush and close injected sample before hashing
This commit is contained in:
1 parent
486f03997c
commit
4efbbd1543
1 file changed
+1
@@ -109,6 +109,7 @@ def download(url, dst):
|
||||
with urllib.request.urlopen(url) as r:
|
||||
while chunk := r.read(1 << 16):
|
||||
tmp.write(chunk)
|
||||
tmp.close()
|
||||
if dst.exists() and digest(dst) != digest(tmp_path):
|
||||
raise ValueError(f"already exists with different content: {dst}")
|
||||
tmp_path.rename(dst)
|
||||
|
||||
Reference in new issue
Block a user