From 5312e9cdacf5ea8da3b692cd7e7ea1fa39a0ce95 Mon Sep 17 00:00:00 2001 From: devicerandom Date: Tue, 24 Feb 2009 10:53:51 +0000 Subject: [PATCH] (libhooke.py) fixed crash when saving playlist with wrong path --- libhooke.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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() -- 2.26.2