Update of /cvsroot/pywin32/pywin32/Pythonwin
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8451
Modified Files:
Tag: py3k
win32uimodule.cpp
Log Message:
Check return from PyWinGlobals_Ensure
More error checking in init function
Create copyright string as unicode
Index: win32uimodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v
retrieving revision 1.39.2.5
retrieving revision 1.39.2.6
diff -C2 -d -r1.39.2.5 -r1.39.2.6
*** win32uimodule.cpp 4 Oct 2008 17:56:54 -0000 1.39.2.5
--- win32uimodule.cpp 4 Oct 2008 18:40:01 -0000 1.39.2.6
***************
*** 2266,2281 ****
RETURN_MODULE;
! PyWinGlobals_Ensure();
#if (PY_VERSION_HEX < 0x03000000)
module = Py_InitModule(uiModName, ui_functions);
- if (!module)
- return;
- dict = PyModule_GetDict(module);
- if (!dict)
- return;
- ui_module_error = PyErr_NewException("win32ui.error", NULL, NULL);
- if (!ui_module_error)
- return;
#else
--- 2266,2274 ----
RETURN_MODULE;
! if (PyWinGlobals_Ensure() == -1)
! RETURN_ERROR;
#if (PY_VERSION_HEX < 0x03000000)
module = Py_InitModule(uiModName, ui_functions);
#else
***************
*** 2288,2307 ****
};
module = PyModule_Create(&win32ui_def);
if (!module)
! return NULL;
dict = PyModule_GetDict(module);
if (!dict)
! return NULL;
ui_module_error = PyErr_NewException("win32ui.error", NULL, NULL);
! if (!ui_module_error)
! return NULL;
! #endif
- PyDict_SetItemString(dict, "error", ui_module_error);
- // drop email addy - too many ppl use it for support requests for other
- // tools that simply embed Pythonwin...
- PyObject *copyright = PyString_FromString("Copyright 1994-2008 Mark Hammond");
- PyDict_SetItemString(dict, "copyright", copyright);
- Py_XDECREF(copyright);
PyObject *dllhandle = PyWinLong_FromHANDLE(hWin32uiDll);
PyDict_SetItemString(dict, "dllhandle", dllhandle);
--- 2281,2303 ----
};
module = PyModule_Create(&win32ui_def);
+ #endif
+
if (!module)
! RETURN_ERROR;
dict = PyModule_GetDict(module);
if (!dict)
! RETURN_ERROR;
!
ui_module_error = PyErr_NewException("win32ui.error", NULL, NULL);
! if ((ui_module_error == NULL) || PyDict_SetItemString(dict, "error", ui_module_error) == -1)
! RETURN_ERROR;
!
! // drop email addy - too many ppl use it for support requests for other
! // tools that simply embed Pythonwin...
! PyObject *copyright = PyWinCoreString_FromString("Copyright 1994-2008 Mark Hammond");
! if ((copyright == NULL) || PyDict_SetItemString(dict, "copyright", copyright) == -1)
! RETURN_ERROR;
! Py_XDECREF(copyright);
PyObject *dllhandle = PyWinLong_FromHANDLE(hWin32uiDll);
PyDict_SetItemString(dict, "dllhandle", dllhandle);
|