change file() statement to open()

This commit is contained in:
Michel Oosterhof
2016-10-23 14:34:32 +00:00
parent 3feab1611e
commit ec457b18d4

View File

@@ -105,11 +105,12 @@ class fseditCmd(cmd.Cmd):
def save_pickle(self): def save_pickle(self):
'''saves the current file system to the pickle''' '''saves the current file system to the pickle'''
try: try:
pickle.dump(self.fs, file(self.pickle_file_path, 'wb')) pickle.dump(self.fs, open(self.pickle_file_path, 'wb'))
except: except Exception as e:
print((("Unable to save pickle file '%s'. " + \ print((("Unable to save pickle file '%s'. " + \
"Are you sure you have write access?") % \ "Are you sure you have write access?") % \
(self.pickle_file_path,))) (self.pickle_file_path,)))
print(str(e))
sys.exit(1) sys.exit(1)
def do_exit(self, args): def do_exit(self, args):