|
|
a5a57d3 |
From 7ea234f00f0d9c166f20e3ddbbd9be147b24bb16 Mon Sep 17 00:00:00 2001
|
|
|
a5a57d3 |
From: Nils Philippsen <nils@redhat.com>
|
|
|
a5a57d3 |
Date: Thu, 26 Nov 2015 00:57:19 +0100
|
|
|
a5a57d3 |
Subject: [PATCH 5/6] Python 3: raise RuntimeErrors, not generic exceptions
|
|
|
a5a57d3 |
|
|
|
a5a57d3 |
---
|
|
|
a5a57d3 |
python/ext/aubiowraphell.h | 2 +-
|
|
|
a5a57d3 |
python/ext/py-sink.c | 2 +-
|
|
|
a5a57d3 |
python/ext/py-source.c | 2 +-
|
|
|
a5a57d3 |
3 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
a5a57d3 |
|
|
|
a5a57d3 |
diff --git a/python/ext/aubiowraphell.h b/python/ext/aubiowraphell.h
|
|
|
a5a57d3 |
index b9146ef..c75567d 100644
|
|
|
a5a57d3 |
--- a/python/ext/aubiowraphell.h
|
|
|
a5a57d3 |
+++ b/python/ext/aubiowraphell.h
|
|
|
a5a57d3 |
@@ -13,7 +13,7 @@ Py_ ## NAME ## _init (Py_ ## NAME * self, PyObject * args, PyObject * kwds) \
|
|
|
a5a57d3 |
{ \
|
|
|
a5a57d3 |
self->o = new_aubio_## NAME ( PARAMS ); \
|
|
|
a5a57d3 |
if (self->o == NULL) { \
|
|
|
a5a57d3 |
- PyErr_SetString (PyExc_StandardError, "error creating object"); \
|
|
|
a5a57d3 |
+ PyErr_SetString (PyExc_RuntimeError, "error creating object"); \
|
|
|
a5a57d3 |
return -1; \
|
|
|
a5a57d3 |
} \
|
|
|
a5a57d3 |
\
|
|
|
a5a57d3 |
diff --git a/python/ext/py-sink.c b/python/ext/py-sink.c
|
|
|
a5a57d3 |
index be5de36..51b9bc3 100644
|
|
|
a5a57d3 |
--- a/python/ext/py-sink.c
|
|
|
a5a57d3 |
+++ b/python/ext/py-sink.c
|
|
|
a5a57d3 |
@@ -115,7 +115,7 @@ Py_sink_init (Py_sink * self, PyObject * args, PyObject * kwds)
|
|
|
a5a57d3 |
aubio_sink_preset_samplerate ( self->o, self->samplerate );
|
|
|
a5a57d3 |
}
|
|
|
a5a57d3 |
if (self->o == NULL) {
|
|
|
a5a57d3 |
- PyErr_SetString (PyExc_StandardError, "error creating sink with this uri");
|
|
|
a5a57d3 |
+ PyErr_SetString (PyExc_RuntimeError, "error creating sink with this uri");
|
|
|
a5a57d3 |
return -1;
|
|
|
a5a57d3 |
}
|
|
|
a5a57d3 |
self->samplerate = aubio_sink_get_samplerate ( self->o );
|
|
|
a5a57d3 |
diff --git a/python/ext/py-source.c b/python/ext/py-source.c
|
|
|
a5a57d3 |
index f9f972f..085b9ea 100644
|
|
|
a5a57d3 |
--- a/python/ext/py-source.c
|
|
|
a5a57d3 |
+++ b/python/ext/py-source.c
|
|
|
a5a57d3 |
@@ -137,7 +137,7 @@ Py_source_init (Py_source * self, PyObject * args, PyObject * kwds)
|
|
|
a5a57d3 |
if (self->o == NULL) {
|
|
|
a5a57d3 |
char_t errstr[30 + strlen(self->uri)];
|
|
|
a5a57d3 |
sprintf(errstr, "error creating source with %s", self->uri);
|
|
|
a5a57d3 |
- PyErr_SetString (PyExc_StandardError, errstr);
|
|
|
a5a57d3 |
+ PyErr_SetString (PyExc_RuntimeError, errstr);
|
|
|
a5a57d3 |
return -1;
|
|
|
a5a57d3 |
}
|
|
|
a5a57d3 |
self->samplerate = aubio_source_get_samplerate ( self->o );
|
|
|
a5a57d3 |
--
|
|
|
a5a57d3 |
2.5.0
|
|
|
a5a57d3 |
|