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 (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
1313 { \
1414 self->o = new_aubio_## NAME ( PARAMS ); \
1515 if (self->o == NULL) { \
16− PyErr_SetString (PyExc_StandardError, "error creating object"); \
16+ PyErr_SetString (PyExc_RuntimeError, "error creating object"); \
1717 return -1; \
1818 } \
1919 \
python/ext/py-sink.c+1−1
@@ -115,7 +115,7 @@ Py_sink_init (Py_sink * self, PyObject * args, PyObject * kwds) · 114 unmodified lines
115115 aubio_sink_preset_samplerate ( self->o, self->samplerate );
116116 }
117117 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");
119119 return -1;
120120 }
121121 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
137137 if (self->o == NULL) {
138138 char_t errstr[30 + strlen(self->uri)];
139139 sprintf(errstr, "error creating source with %s", self->uri);
140− PyErr_SetString (PyExc_StandardError, errstr);
140+ PyErr_SetString (PyExc_RuntimeError, errstr);
141141 return -1;
142142 }
143143 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