History

aubioclass.py: make sndfile raise error if file not opened, do not delete it if == None, avoiding several segfaults

Paul Brossier committed 19 years ago

Commit cea30b81 parent d1ec8cb1 file · +2 −1Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubio/aubioclass.py+2−1
@@ -42,8 +42,9 @@ class sndfile: · 41 unmodified lines
4242 self.file = new_aubio_sndfile_wo(model.file,filename)
4343 else:
4444 self.file = new_aubio_sndfile_ro(filename)
45+ if self.file == None: raise(ValueError, "failed opening file")
4546 def __del__(self):
46− del_aubio_sndfile(self.file)
47+ if self.file != None: del_aubio_sndfile(self.file)
4748 def info(self):
4849 aubio_sndfile_info(self.file)
4950 def samplerate(self):

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t