mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
gitkpkgv: Ensure files are closed
This avoids warnings with python 3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
parent
b4d7caaff9
commit
55cb2ec6db
|
|
@ -87,11 +87,13 @@ def get_git_pkgv(d, use_tags):
|
|||
|
||||
if commits != "":
|
||||
oe.path.remove(rev_file, recurse=False)
|
||||
open(rev_file, "w").write("%d\n" % int(commits))
|
||||
with open(rev_file, "w") as f:
|
||||
f.write("%d\n" % int(commits))
|
||||
else:
|
||||
commits = "0"
|
||||
else:
|
||||
commits = open(rev_file, "r").readline(128).strip()
|
||||
with open(rev_file, "r") as f:
|
||||
commits = f.readline(128).strip()
|
||||
|
||||
if use_tags:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user