s4-python: Remove convenience macro PyErr_SetStringError.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 3 Apr 2010 22:22:29 +0000 (00:22 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 3 Apr 2010 22:22:29 +0000 (00:22 +0200)
This macro assumed that all errors were runtime errors.

source4/auth/credentials/pycredentials.c
source4/libcli/util/pyerrors.h
source4/scripting/python/pyglue.c

index f5e802958b009b9e7cc00f6409836d281430abc5..cd578a5c116d29d857dc04bf9c66a9cae9142503 100644 (file)
@@ -272,7 +272,7 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg
                return PyCredentialCacheContainer_from_ccache_container(ccc);
        }
 
-       PyErr_SetStringError(error_string);
+       PyErr_SetString(PyExc_RuntimeError, error_string);
 
        talloc_free(event_ctx);
        return NULL;
index 3fd2a7c9fabb44fadab94a2040928bc5d058b1c2..4c526c6ed284459aaa1cb0cffd7771afc67e9d9c 100644 (file)
@@ -26,9 +26,6 @@
 
 #define PyErr_FromString(str) Py_BuildValue("(s)", discard_const_p(char, str))
 
-#define PyErr_SetStringError(str) \
-        PyErr_SetObject(PyExc_RuntimeError, PyErr_FromString(str))
-
 #define PyErr_SetWERROR(err) \
        PyErr_SetObject(PyExc_RuntimeError, PyErr_FromWERROR(err))
 
index 5fa02b367ddcd4177ed536083765494b91649774..852231f68179f6998af89591b7fc72cd4b3830ee 100644 (file)
@@ -513,7 +513,7 @@ static PyObject *py_samdb_ntds_invocation_id(PyObject *self, PyObject *args)
 
        guid = samdb_ntds_invocation_id(ldb);
        if (guid == NULL) {
-               PyErr_SetStringError("Failed to find NTDS invocation ID");
+               PyErr_SetString(PyExc_RuntimeError, "Failed to find NTDS invocation ID");
                talloc_free(mem_ctx);
                return NULL;
        }
@@ -546,7 +546,7 @@ static PyObject *py_samdb_ntds_objectGUID(PyObject *self, PyObject *args)
 
        guid = samdb_ntds_objectGUID(ldb);
        if (guid == NULL) {
-               PyErr_SetStringError("Failed to find NTDS GUID");
+               PyErr_SetString(PyExc_RuntimeError, "Failed to find NTDS GUID");
                talloc_free(mem_ctx);
                return NULL;
        }