mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-04 14:39:54 +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:
committed by
Martin Jansa
parent
b4d7caaff9
commit
55cb2ec6db
@@ -87,11 +87,13 @@ def get_git_pkgv(d, use_tags):
|
|||||||
|
|
||||||
if commits != "":
|
if commits != "":
|
||||||
oe.path.remove(rev_file, recurse=False)
|
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:
|
else:
|
||||||
commits = "0"
|
commits = "0"
|
||||||
else:
|
else:
|
||||||
commits = open(rev_file, "r").readline(128).strip()
|
with open(rev_file, "r") as f:
|
||||||
|
commits = f.readline(128).strip()
|
||||||
|
|
||||||
if use_tags:
|
if use_tags:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user