mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not supported at all.
This commit is contained in:
parent
112aad3630
commit
100a4e944b
2 changed files with 6 additions and 0 deletions
|
@ -348,7 +348,9 @@ void init_callbacks_in_module(PyObject *m)
|
||||||
static void LoadPython(void)
|
static void LoadPython(void)
|
||||||
{
|
{
|
||||||
if (!Py_IsInitialized()) {
|
if (!Py_IsInitialized()) {
|
||||||
|
#ifdef WITH_THREAD
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
|
#endif
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -818,7 +818,9 @@ GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
|
||||||
/* We absolutely have to release the GIL during COM method calls,
|
/* We absolutely have to release the GIL during COM method calls,
|
||||||
otherwise we may get a deadlock!
|
otherwise we may get a deadlock!
|
||||||
*/
|
*/
|
||||||
|
#ifdef WITH_THREAD
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
|
#endif
|
||||||
|
|
||||||
hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
|
hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
|
@ -842,7 +844,9 @@ GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
|
||||||
pei->lpVtbl->Release(pei);
|
pei->lpVtbl->Release(pei);
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
#ifdef WITH_THREAD
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
#endif
|
||||||
|
|
||||||
progid = NULL;
|
progid = NULL;
|
||||||
ProgIDFromCLSID(&guid, &progid);
|
ProgIDFromCLSID(&guid, &progid);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue