Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21533
Modified Files:
Tag: py3k
PyWinTypes.h PyWinTypesmodule.cpp
Log Message:
Call PyType_Ready in PyWinGlobals_Ensure
Return error code from PyWinGlobals_Ensure
Index: PyWinTypesmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v
retrieving revision 1.39.2.3
retrieving revision 1.39.2.4
diff -C2 -d -r1.39.2.3 -r1.39.2.4
*** PyWinTypesmodule.cpp 12 Sep 2008 07:04:46 -0000 1.39.2.3
--- PyWinTypesmodule.cpp 27 Sep 2008 15:56:00 -0000 1.39.2.4
***************
*** 836,840 ****
};
! void PyWinGlobals_Ensure()
{
PyEval_InitThreads();
--- 836,840 ----
};
! int PyWinGlobals_Ensure()
{
PyEval_InitThreads();
***************
*** 842,847 ****
if (PyWinExc_ApiError==NULL) {
PyWinExc_ApiError = PyErr_NewException("pywintypes.error", NULL, NULL);
PyWinExc_COMError = PyErr_NewException("pywintypes.com_error", NULL, NULL);
! }
}
--- 842,880 ----
if (PyWinExc_ApiError==NULL) {
PyWinExc_ApiError = PyErr_NewException("pywintypes.error", NULL, NULL);
+ if (PyWinExc_ApiError==NULL)
+ return -1;
+ }
+ if (PyWinExc_COMError == NULL){
PyWinExc_COMError = PyErr_NewException("pywintypes.com_error", NULL, NULL);
! if (PyWinExc_COMError == NULL)
! return -1;
! }
!
! /* PyType_Ready needs to be called anytime pywintypesxx.dll is loaded, since
! other extension modules can use types defined here without pywintypes itself
! having been imported.
! ??? All extension modules that call this need to be changed to check the exit code ???
! */
! if (PyType_Ready(&PyHANDLEType) == -1
! ||PyType_Ready(&PyOVERLAPPEDType) == -1
! ||PyType_Ready(&PyDEVMODEType) == -1
! ||PyType_Ready(&PyDEVMODEWType) == -1
! ||PyType_Ready(&PyWAVEFORMATEXType) == -1
! #ifndef NO_PYWINTYPES_TIME
! ||PyType_Ready(&PyTimeType) == -1
! #endif // NO_PYWINTYPES_TIME
! #ifndef NO_PYWINTYPES_IID
! ||PyType_Ready(&PyIIDType) == -1
! #endif // NO_PYWINTYPES_IID
! #ifndef NO_PYWINTYPES_SECURITY
! ||PyType_Ready(&PySECURITY_DESCRIPTORType) == -1
! ||PyType_Ready(&PySECURITY_ATTRIBUTESType) == -1
! ||PyType_Ready(&PySIDType) == -1
! ||PyType_Ready(&PyACLType) == -1
! #endif
! )
! return -1;
!
! return 0;
}
Index: PyWinTypes.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v
retrieving revision 1.51.2.2
retrieving revision 1.51.2.3
diff -C2 -d -r1.51.2.2 -r1.51.2.3
*** PyWinTypes.h 31 Aug 2008 02:11:22 -0000 1.51.2.2
--- PyWinTypes.h 27 Sep 2008 15:56:00 -0000 1.51.2.3
***************
*** 672,676 ****
extern PYWINTYPES_EXPORT void PyWinInterpreterLock_Release();
! extern PYWINTYPES_EXPORT void PyWinGlobals_Ensure();
extern PYWINTYPES_EXPORT void PyWinGlobals_Free();
#else
--- 672,676 ----
extern PYWINTYPES_EXPORT void PyWinInterpreterLock_Release();
! extern PYWINTYPES_EXPORT int PyWinGlobals_Ensure();
extern PYWINTYPES_EXPORT void PyWinGlobals_Free();
#else
|