summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-06 10:41:31 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-06 18:06:50 +0200
commitefe28b124770eaa66e39b1e9c717358d53547bd5 (patch)
tree5493540333f97409fd8fd69c8233d7f50f1ce54a /source4/libcli
parenta370792cbc7285da90ef261d03efe781075ff71b (diff)
downloadsamba-efe28b124770eaa66e39b1e9c717358d53547bd5.tar.gz
samba-efe28b124770eaa66e39b1e9c717358d53547bd5.tar.bz2
samba-efe28b124770eaa66e39b1e9c717358d53547bd5.zip
s4:libcli/pyerrors: add PyErr_NTSTATUS_NOT_OK_RAISE()
metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Aug 6 18:06:50 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/util/pyerrors.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/util/pyerrors.h b/source4/libcli/util/pyerrors.h
index e3e7bc4aac..0241e961e5 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); \