The old implementation would complain of unsaved playlists upon
exiting if it was different from the originally loaded version, even
if you'd just saved the playlist! We also switch to the more robust
`with` syntax:
http://www.python.org/dev/peps/pep-0343/
"""Saves the playlist in a XML file.
"""
self.set_path(path)
- f = file(self.path, 'w')
- f.write(self.flatten())
- f.close()
+ with open(self.path, 'w') as f:
+ f.write(self.flatten())
+ self._digest = self.digest()