mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
research
This commit is contained in:
@@ -9,7 +9,6 @@ extern "C" __declspec(dllexport) void InitPythonEnv()
|
||||
{
|
||||
Py_Initialize();
|
||||
PyEval_InitThreads();
|
||||
PyEval_ReleaseLock();
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>ǰִ<C7B0>У<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ͷ<EFBFBD>PyEval_InitThreads<64><73><EFBFBD>õ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳̿<DFB3><CCBF><EFBFBD><EFBFBD><EFBFBD><DEB7><EFBFBD>ȡ<EFBFBD><C8A1>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
|
||||
@@ -32,8 +31,8 @@ char* Exec(char* directory, char* file, char* method, char* para)
|
||||
PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pClass, *pInstance;
|
||||
char *error;
|
||||
|
||||
PyEval_ReleaseLock();
|
||||
PyGILState_STATE gstate = PyGILState_Ensure();
|
||||
|
||||
// Build the name object
|
||||
PyObject *path = PySys_GetObject("path");
|
||||
PyList_Append(path, PyString_FromString(directory));
|
||||
@@ -91,14 +90,13 @@ char* Exec(char* directory, char* file, char* method, char* para)
|
||||
|
||||
//PyErr_Clear();
|
||||
PyGILState_Release(gstate);
|
||||
|
||||
return str_ret;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) char* ExecPython(char* directory, char* file, char* method, char* para)
|
||||
{
|
||||
//PyEval_ReleaseLock();
|
||||
char* s = Exec(directory,file,method,para);
|
||||
PyGILState_Ensure();
|
||||
return s;
|
||||
//auto future = std::async(Exec,directory,file,method,para);
|
||||
//return future.get();
|
||||
|
||||
Reference in New Issue
Block a user