replace obsolete file() -> open()
This commit is contained in:
parent
a265f1fd38
commit
319a36b2b8
@ -116,9 +116,8 @@ class Zipfile:
|
||||
os.mkdir(fullname)
|
||||
for name in self.get_files(names):
|
||||
fullname = os.path.join(path, name)
|
||||
outfile = file(fullname, 'wb')
|
||||
outfile.write(self.zip_obj.read(name))
|
||||
outfile.close()
|
||||
with open(fullname, 'wb') as outfile:
|
||||
outfile.write(self.zip_obj.read(name))
|
||||
|
||||
def extractfile(self, name):
|
||||
"""
|
||||
|
@ -463,7 +463,7 @@ class GrampsImportFileDialog(ManagedWindow):
|
||||
return True
|
||||
else:
|
||||
try:
|
||||
f = file(filename,'w')
|
||||
f = open(filename,'w')
|
||||
f.close()
|
||||
os.remove(filename)
|
||||
except IOError:
|
||||
|
Loading…
Reference in New Issue
Block a user