From: Stefan Metzmacher Date: Mon, 6 Aug 2012 08:41:31 +0000 (+0200) Subject: s4:libcli/pyerrors: add PyErr_NTSTATUS_NOT_OK_RAISE() X-Git-Tag: ldb-1.1.10~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efe28b124770eaa66e39b1e9c717358d53547bd5;p=thirdparty%2Fsamba.git s4:libcli/pyerrors: add PyErr_NTSTATUS_NOT_OK_RAISE() metze Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Mon Aug 6 18:06:50 CEST 2012 on sn-devel-104 --- diff --git a/source4/libcli/util/pyerrors.h b/source4/libcli/util/pyerrors.h index e3e7bc4aac3..0241e961e5e 100644 --- a/source4/libcli/util/pyerrors.h +++ b/source4/libcli/util/pyerrors.h @@ -38,6 +38,12 @@ return NULL; \ } +#define PyErr_NTSTATUS_NOT_OK_RAISE(status) \ + if (!NT_STATUS_IS_OK(status)) { \ + PyErr_SetNTSTATUS(status); \ + return NULL; \ + } + #define PyErr_WERROR_NOT_OK_RAISE(status) \ if (!W_ERROR_IS_OK(status)) { \ PyErr_SetWERROR(status); \