summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/auth/credentials/pycredentials.c2
-rw-r--r--source4/libcli/util/pyerrors.h3
-rw-r--r--source4/scripting/python/pyglue.c4
3 files changed, 3 insertions, 6 deletions
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index f5e802958b..cd578a5c11 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -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;
diff --git a/source4/libcli/util/pyerrors.h b/source4/libcli/util/pyerrors.h
index 3fd2a7c9fa..4c526c6ed2 100644
--- a/source4/libcli/util/pyerrors.h
+++ b/source4/libcli/util/pyerrors.h
@@ -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))
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c
index 5fa02b367d..852231f681 100644
--- a/source4/scripting/python/pyglue.c
+++ b/source4/scripting/python/pyglue.c
@@ -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;
}