shithub: aubio

Download patch

ref: ac7e49b28822698ccae7f26b928f4f56b82d2cb1
parent: 770b9e745c48b68ffb3f274adee0d14d52274868
author: Nils Philippsen <nils@tiptoe.de>
date: Wed Nov 25 19:57:19 EST 2015

Python 3: raise RuntimeErrors, not generic exceptions

--- a/python/ext/aubiowraphell.h
+++ b/python/ext/aubiowraphell.h
@@ -13,7 +13,7 @@
 { \
   self->o = new_aubio_## NAME ( PARAMS ); \
   if (self->o == NULL) { \
-    PyErr_SetString (PyExc_StandardError, "error creating object"); \
+    PyErr_SetString (PyExc_RuntimeError, "error creating object"); \
     return -1; \
   } \
 \
--- a/python/ext/py-sink.c
+++ b/python/ext/py-sink.c
@@ -115,7 +115,7 @@
     aubio_sink_preset_samplerate ( self->o, self->samplerate );
   }
   if (self->o == NULL) {
-    PyErr_SetString (PyExc_StandardError, "error creating sink with this uri");
+    PyErr_SetString (PyExc_RuntimeError, "error creating sink with this uri");
     return -1;
   }
   self->samplerate = aubio_sink_get_samplerate ( self->o );
--- a/python/ext/py-source.c
+++ b/python/ext/py-source.c
@@ -137,7 +137,7 @@
   if (self->o == NULL) {
     char_t errstr[30 + strlen(self->uri)];
     sprintf(errstr, "error creating source with %s", self->uri);
-    PyErr_SetString (PyExc_StandardError, errstr);
+    PyErr_SetString (PyExc_RuntimeError, errstr);
     return -1;
   }
   self->samplerate = aubio_source_get_samplerate ( self->o );