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