diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-02 20:35:10 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-02 20:35:10 +0200 |
| commit | 0c2e8df558514b8e0d85d011857f3c2984e39f6e (patch) | |
| tree | af2e0426c8c86da171c79fa6bfe0b4f90b970ee3 /Python/dynload_win.c | |
| parent | ca68997fb8ada5c2a95caaf984f29bf02732336a (diff) | |
| download | cpython-0c2e8df558514b8e0d85d011857f3c2984e39f6e.tar.gz | |
Check error when calling PyUnicode_AppendAndDel()
Diffstat (limited to 'Python/dynload_win.c')
| -rw-r--r-- | Python/dynload_win.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 932a637680..c620e58948 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -187,7 +187,7 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, HINSTANCE hDLL = NULL; unsigned int old_mode; ULONG_PTR cookie = 0; - + /* Don't display a message box when Python can't load a DLL */ old_mode = SetErrorMode(SEM_FAILCRITICALERRORS); @@ -248,8 +248,10 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, theInfo, theLength)); } - PyErr_SetObject(PyExc_ImportError, message); - Py_XDECREF(message); + if (message != NULL) { + PyErr_SetObject(PyExc_ImportError, message); + Py_DECREF(message); + } return NULL; } else { char buffer[256]; |
