Change-Id: I8fb9b2654f2020bbf03e6e429f8bb395a7e345f8
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
# Read per-tree config file
if repo and git_treeish and filename.startswith('%(top_dir)s/'):
- with tempfile.TemporaryFile() as tmp:
+ with tempfile.NamedTemporaryFile() as tmp:
relpath = filename.replace('%(top_dir)s/', '')
try:
config = repo.show('%s:%s' % (git_treeish, relpath))
- tmp.writelines(config)
+ tmp.write(config)
except GitRepositoryError:
pass
tmp.seek(0)
- parser.readfp(tmp)
+ parser.read(tmp.name)
return
try:
filename = filename % str_fields