mirror of
https://git.yoctoproject.org/poky
synced 2026-09-20 03:49:32 +02:00
yocto-bsp: have replace_file() close file before copying
replace_file needs to make sure the file it's replacing is closed before replacing it, otherwise unexpected results may ensue. Fixes [YOCTO #4145]. (From meta-yocto rev: 1339dbb690d51456b4474356992e430638469e47) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
fd67cfd1c5
commit
df1ad143c3
@@ -571,7 +571,8 @@ def replace_file(replace_this, with_this):
|
|||||||
the original filename.
|
the original filename.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
shutil.copy(with_this, replace_this)
|
replace_this.close()
|
||||||
|
shutil.copy(with_this, replace_this.name)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user