Skip to content

Commit

Permalink
Fix initialization of pythoncom.Nothing (fixes #1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhammond committed Oct 24, 2020
1 parent 201db64 commit daeb5f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion com/win32com/src/MiscTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void nothing_dealloc(PyOleNothing *o) { delete o; }

PyTypeObject PyOleNothingType = {
PYWIN_OBJECT_HEAD "PyOleNothing",
sizeof(PyOleNothingType),
sizeof(PyOleNothing),
0,
(destructor)nothing_dealloc, /*tp_dealloc*/
0, /*tp_print*/
Expand Down
6 changes: 4 additions & 2 deletions com/win32com/src/PythonCOM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2237,8 +2237,10 @@ PYWIN_MODULE_INIT_FUNC(pythoncom)
PyDict_SetItemString(dict, "ServerInterfaces", g_obPyCom_MapGatewayIIDToName);
PyDict_SetItemString(dict, "InterfaceNames", g_obPyCom_MapInterfaceNameToIID);

if (PyType_Ready(&PyOleEmptyType) == -1 || PyType_Ready(&PyOleMissingType) == -1 ||
PyType_Ready(&PyOleArgNotFoundType) == -1)
if (PyType_Ready(&PyOleEmptyType) == -1 ||
PyType_Ready(&PyOleMissingType) == -1 ||
PyType_Ready(&PyOleArgNotFoundType) == -1 ||
PyType_Ready(&PyOleNothingType) == -1)
PYWIN_MODULE_INIT_RETURN_ERROR;
g_obEmpty = new PyOleEmpty;
PyDict_SetItemString(dict, "Empty", g_obEmpty);
Expand Down

0 comments on commit daeb5f2

Please sign in to comment.