summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Groszer <agroszer@gmail.com>2013-03-07 14:49:56 +0000
committerAdam Groszer <agroszer@gmail.com>2013-03-07 14:49:56 +0000
commit1af6989173c84e004f1639b1db61cba187d136b2 (patch)
tree0ff72800f5a412462ae8a2ec6eca0d02cccd1e8f
parent89790a7ade438326cfb610acf77d437511572f40 (diff)
downloadzope-security-1af6989173c84e004f1639b1db61cba187d136b2.tar.gz
Fix build error with MSVC++ on Python 3
-rw-r--r--src/zope/security/_proxy.c10
-rw-r--r--src/zope/security/_zope_security_checker.c14
2 files changed, 12 insertions, 12 deletions
diff --git a/src/zope/security/_proxy.c b/src/zope/security/_proxy.c
index 52b5040..27edbb3 100644
--- a/src/zope/security/_proxy.c
+++ b/src/zope/security/_proxy.c
@@ -983,6 +983,11 @@ MOD_INIT(_proxy)
{
PyObject *m;
+ MOD_DEF(m, "_proxy", module___doc__, module_functions)
+
+ if (m == NULL)
+ return MOD_ERROR_VAL;
+
if (Proxy_Import() < 0)
return MOD_ERROR_VAL;
@@ -1083,11 +1088,6 @@ if((str_op_##S = INTERN("__" #S "__")) == NULL) return MOD_ERROR_VAL
if (PyType_Ready(&SecurityProxyType) < 0)
return MOD_ERROR_VAL;
- MOD_DEF(m, "_proxy", module___doc__, module_functions)
-
- if (m == NULL)
- return MOD_ERROR_VAL;
-
Py_INCREF(&SecurityProxyType);
PyModule_AddObject(m, "_Proxy", (PyObject *)&SecurityProxyType);
diff --git a/src/zope/security/_zope_security_checker.c b/src/zope/security/_zope_security_checker.c
index 1b91312..25b6eeb 100644
--- a/src/zope/security/_zope_security_checker.c
+++ b/src/zope/security/_zope_security_checker.c
@@ -590,6 +590,13 @@ MOD_INIT(_zope_security_checker)
{
PyObject* m;
+ MOD_DEF(m, "_zope_security_checker", module___doc__, module_functions)
+
+ if (m == NULL)
+ {
+ return MOD_ERROR_VAL;
+ }
+
CheckerType.tp_new = PyType_GenericNew;
if (PyType_Ready(&CheckerType) < 0)
{
@@ -673,13 +680,6 @@ if((str_##S = INTERN(#S)) == NULL) return MOD_ERROR_VAL
return MOD_ERROR_VAL;
}
- MOD_DEF(m, "_zope_security_checker", module___doc__, module_functions)
-
- if (m == NULL)
- {
- return MOD_ERROR_VAL;
- }
-
#define EXPORT(N) Py_INCREF(N); PyModule_AddObject(m, #N, N)
EXPORT(_checkers);