History

Python 3: raise RuntimeErrors, not generic exceptions

Nils Philippsen committed 10 years ago

Commit ac7e49b1 parent 770b9e73 files · +3 −3Browse files

Showing the changes to python/ext (3 of 3 files). Show all

Unified · Split

3 files
  1. python/ext/aubiowraphell.h +1 −1
  2. python/ext/py-sink.c +1 −1
  3. python/ext/py-source.c +1 −1
python/ext/aubiowraphell.h+1−1
@@ -13,7 +13,7 @@ Py_ ## NAME ## _init (Py_ ## NAME * self, PyObject * args, PyObject * kwds) \ · 12 unmodified lines
13{ \13{ \
14 self->o = new_aubio_## NAME ( PARAMS ); \14 self->o = new_aubio_## NAME ( PARAMS ); \
15 if (self->o == NULL) { \15 if (self->o == NULL) { \
16 PyErr_SetString (PyExc_StandardError, "error creating object"); \16 PyErr_SetString (PyExc_RuntimeError, "error creating object"); \
17 return -1; \17 return -1; \
18 } \18 } \
19\19\
python/ext/py-sink.c+1−1
@@ -115,7 +115,7 @@ Py_sink_init (Py_sink * self, PyObject * args, PyObject * kwds) · 114 unmodified lines
115 aubio_sink_preset_samplerate ( self->o, self->samplerate );115 aubio_sink_preset_samplerate ( self->o, self->samplerate );
116 }116 }
117 if (self->o == NULL) {117 if (self->o == NULL) {
118 PyErr_SetString (PyExc_StandardError, "error creating sink with this uri");118 PyErr_SetString (PyExc_RuntimeError, "error creating sink with this uri");
119 return -1;119 return -1;
120 }120 }
121 self->samplerate = aubio_sink_get_samplerate ( self->o );121 self->samplerate = aubio_sink_get_samplerate ( self->o );
python/ext/py-source.c+1−1
@@ -137,7 +137,7 @@ Py_source_init (Py_source * self, PyObject * args, PyObject * kwds) · 136 unmodified lines
137 if (self->o == NULL) {137 if (self->o == NULL) {
138 char_t errstr[30 + strlen(self->uri)];138 char_t errstr[30 + strlen(self->uri)];
139 sprintf(errstr, "error creating source with %s", self->uri);139 sprintf(errstr, "error creating source with %s", self->uri);
140 PyErr_SetString (PyExc_StandardError, errstr);140 PyErr_SetString (PyExc_RuntimeError, errstr);
141 return -1;141 return -1;
142 }142 }
143 self->samplerate = aubio_source_get_samplerate ( self->o );143 self->samplerate = aubio_source_get_samplerate ( self->o );

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