Skip to content

Commit 48f1b14

Browse files
committed
Actually check if the win32ui import worked before saying it didn't!
1 parent da085a8 commit 48f1b14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Pythonwin/Win32uiHostGlue.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ inline BOOL Win32uiHostGlue::DynamicApplicationInit(const TCHAR *cmd, const TCHA
213213
if (pfnPyRun_SimpleString)
214214
pfnPyRun_SimpleString("import win32ui");
215215
hModWin32ui = GetModuleHandle(szWinui_Name);
216-
wsprintf(err_buf, _T("Failed to load win32ui after attempting an import' - %d\n"), GetLastError());
217-
goto fail_with_error_dlg;
216+
if (!hModWin32ui) {
217+
wsprintf(err_buf, _T("Failed to load win32ui after attempting an import' - %d\n"), GetLastError());
218+
goto fail_with_error_dlg;
219+
}
218220
}
219221

220222
BOOL(__cdecl * pfnWin32uiInit)(Win32uiHostGlue *, TCHAR *, const TCHAR *);

0 commit comments

Comments
 (0)