Skip to content

Commit

Permalink
Fix file() -> open()
Browse files Browse the repository at this point in the history
  • Loading branch information
dsheeler committed Jun 22, 2020
1 parent 5a7f0e2 commit 03d5ebd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jack_mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def on_open_cb(self, *args):
if dlg.run() == Gtk.ResponseType.OK:
filename = dlg.get_filename()
try:
f = file(filename, 'r')
f = open(filename, 'r')
self.load_from_xml(f)
except:
err = Gtk.MessageDialog(self.window,
Expand All @@ -265,7 +265,7 @@ def on_open_cb(self, *args):
def on_save_cb(self, *args):
if not self.current_filename:
return self.on_save_as_cb()
f = file(self.current_filename, 'w')
f = open(self.current_filename, 'w')
self.save_to_xml(f)
f.close()

Expand Down Expand Up @@ -605,15 +605,15 @@ def lash_check_events(self):
directory = lash.lash_event_get_string(event)
print("jack_mixer: LASH ordered to save data in directory %s" % directory)
filename = directory + os.sep + "jack_mixer.xml"
f = file(filename, "w")
f = open(filename, "w")
self.save_to_xml(f)
f.close()
lash.lash_send_event(self.lash_client, event) # we crash with double free
elif event_type == lash.LASH_Restore_File:
directory = lash.lash_event_get_string(event)
print("jack_mixer: LASH ordered to restore data from directory %s" % directory)
filename = directory + os.sep + "jack_mixer.xml"
f = file(filename, "r")
f = open(filename, "r")
self.load_from_xml(f, silence_errors=True)
f.close()
lash.lash_send_event(self.lash_client, event)
Expand Down

0 comments on commit 03d5ebd

Please sign in to comment.