Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7068
Modified Files:
Tag: py3k
AXScript.cpp
Log Message:
Convert module init for Py3k
Index: AXScript.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/src/AXScript.cpp,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** AXScript.cpp 9 Feb 2001 07:35:53 -0000 1.3
--- AXScript.cpp 14 Sep 2008 06:02:56 -0000 1.3.4.1
***************
*** 141,154 ****
/* Module initialisation */
! extern "C" __declspec(dllexport) void initaxscript()
{
char *modName = "axscript";
- PyObject *oModule;
// Create the module and add the functions
! oModule = Py_InitModule(modName, axcom_methods);
! if (!oModule) /* Eeek - some serious error! */
! return;
! PyObject *dict = PyModule_GetDict(oModule);
! if (!dict) return; /* Another serious error!*/
// Register all of our interfaces, gateways and IIDs.
--- 141,175 ----
/* Module initialisation */
! extern "C" __declspec(dllexport)
! #if (PY_VERSION_HEX < 0x03000000)
! void initaxscript(void)
! #else
! PyObject *PyInit_axscript(void)
! #endif
{
+ PyObject *dict, *module;
char *modName = "axscript";
// Create the module and add the functions
! #if (PY_VERSION_HEX < 0x03000000)
! #define RETURN_ERROR return;
! module = Py_InitModule(modName, axcom_methods);
!
! #else
! #define RETURN_ERROR return NULL;
! static PyModuleDef axscript_def = {
! PyModuleDef_HEAD_INIT,
! "axscript",
! "A module, encapsulating the ActiveX Scripting interfaces.",
! -1,
! axcom_methods
! };
! module = PyModule_Create(&axscript_def);
! #endif
!
! if (!module) /* Eeek - some serious error! */
! RETURN_ERROR;
! dict = PyModule_GetDict(module);
! if (!dict) /* Another serious error!*/
! RETURN_ERROR;
// Register all of our interfaces, gateways and IIDs.
***************
*** 211,213 ****
--- 232,238 ----
ADD_CONSTANT(INTERFACE_USES_SECURITY_MANAGER); // Object knows to use IInternetHostSecurityManager
#endif
+
+ #if (PY_VERSION_HEX >= 0x03000000)
+ return module;
+ #endif
}
|