replace obsolete file() -> open()

This commit is contained in:
CWSchulze 2020-05-22 16:18:17 +02:00 committed by prculley
parent a265f1fd38
commit 319a36b2b8
2 changed files with 3 additions and 4 deletions

View File

@ -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')
with open(fullname, 'wb') as outfile:
outfile.write(self.zip_obj.read(name))
outfile.close()
def extractfile(self, name):
"""

View File

@ -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: