wesnoth_addon_manager: removed two calls to file()
This commit is contained in:
parent
772b871dec
commit
c72ea20c99
1 changed files with 4 additions and 2 deletions
|
@ -123,7 +123,8 @@ if __name__ == "__main__":
|
|||
pcounter = cs.counter
|
||||
|
||||
if args.raw_download:
|
||||
file(name, "w").write(mythread.data)
|
||||
with open(name, "wb") as f:
|
||||
f.write(mythread.data)
|
||||
else:
|
||||
decoded = cs.decode(mythread.data)
|
||||
dirname = os.path.join(cdir, name)
|
||||
|
@ -278,7 +279,8 @@ if __name__ == "__main__":
|
|||
|
||||
elif args.unpack:
|
||||
cs = CampaignClient(address)
|
||||
data = file(args.unpack).read()
|
||||
with open(args.unpack, "rb") as f:
|
||||
data = f.read()
|
||||
decoded = cs.decode(data)
|
||||
print("Unpacking %s..." % args.unpack)
|
||||
cs.unpackdir(decoded, args.campaigns_dir, verbose=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue