From: devicerandom Date: Tue, 24 Feb 2009 10:53:51 +0000 (+0000) Subject: (libhooke.py) fixed crash when saving playlist with wrong path X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=63c63bd173320130e0ba6b4bc37dcde9bedf9adf;p=hooke.git (libhooke.py) fixed crash when saving playlist with wrong path --- diff --git a/libhooke.py b/libhooke.py index f26b89a..25ee935 100755 --- a/libhooke.py +++ b/libhooke.py @@ -124,8 +124,13 @@ class PlaylistXML: def save(self,output_filename): ''' saves the playlist in a XML file. - ''' - outfile=file(output_filename,'w') + ''' + try: + outfile=file(output_filename,'w') + except IOError: + print 'libhooke.py : Cannot save playlist. Wrong path or filename' + return + self.playlist.writexml(outfile,indent='\n') outfile.close()