From cbad134dd453a24d3e0e55ad81dff0e0baa2f7e9 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 9 Oct 2009 09:35:42 +0300 Subject: [PATCH] Kill off _rpmb.error exception type - import of _rpmb messes up rpm.error to point to _rpmb.error which we do not want - use ValueError for unparsable spec for now, need to figure something saner there still --- python/rpmbmodule.c | 7 ------- python/spec-py.c | 2 +- python/spec-py.h | 2 -- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/python/rpmbmodule.c b/python/rpmbmodule.c index 2c18ed35a..2332590f2 100644 --- a/python/rpmbmodule.c +++ b/python/rpmbmodule.c @@ -4,9 +4,6 @@ #include "debug.h" -/* hmm.. figure something better */ -PyObject * pyrpmbError; - static char rpmb__doc__[] = ""; @@ -24,10 +21,6 @@ void init_rpmb(void) d = PyModule_GetDict(m); - pyrpmbError = PyErr_NewException("_rpmb.error", NULL, NULL); - if (pyrpmbError != NULL) - PyDict_SetItemString(d, "error", pyrpmbError); - Py_INCREF(&spec_Type); PyModule_AddObject(m, "spec", (PyObject *) &spec_Type); diff --git a/python/spec-py.c b/python/spec-py.c index f9964f749..6b89d9738 100644 --- a/python/spec-py.c +++ b/python/spec-py.c @@ -168,7 +168,7 @@ static PyObject *spec_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) cookie, anyarch, force) == 0) { spec = rpmtsSpec(ts); } else { - PyErr_SetString(pyrpmbError, "can't parse specfile\n"); + PyErr_SetString(PyExc_ValueError, "can't parse specfile\n"); } rpmtsFree(ts); diff --git a/python/spec-py.h b/python/spec-py.h index b5220294c..30c5cd977 100644 --- a/python/spec-py.h +++ b/python/spec-py.h @@ -7,8 +7,6 @@ typedef struct specObject_s specObject; extern PyTypeObject spec_Type; -extern PyObject *pyrpmbError; - #define specObject_Check(v) ((v)->ob_type == &spec_Type) rpmSpec specFromSpec(specObject * spec);