mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Simplify some file logic with "with"
This commit is contained in:
parent
2894786ec9
commit
6fe8d96e85
4 changed files with 48 additions and 63 deletions
|
|
@ -1097,9 +1097,8 @@ def main():
|
|||
build_succeeded.append(app)
|
||||
wikilog = "Build succeeded"
|
||||
except BuildException as be:
|
||||
logfile = open(os.path.join(log_dir, appid + '.log'), 'a+')
|
||||
logfile.write(str(be))
|
||||
logfile.close()
|
||||
with open(os.path.join(log_dir, appid + '.log'), 'a+') as f:
|
||||
f.write(str(be))
|
||||
print("Could not build app %s due to BuildException: %s" % (appid, be))
|
||||
if options.stop:
|
||||
sys.exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue