equal
deleted
inserted
replaced
5 |
5 |
6 This software may be used and distributed according to the terms of the |
6 This software may be used and distributed according to the terms of the |
7 GNU General Public License version 2 or any later version. |
7 GNU General Public License version 2 or any later version. |
8 */ |
8 */ |
9 |
9 |
|
10 #include <Python.h> |
10 #include <stdio.h> |
11 #include <stdio.h> |
11 #include <tchar.h> |
12 #include <tchar.h> |
12 #include <windows.h> |
13 #include <windows.h> |
13 |
14 |
14 #include "hgpythonlib.h" |
15 #include "hgpythonlib.h" |
43 HANDLE hfind; |
44 HANDLE hfind; |
44 const char *err; |
45 const char *err; |
45 HMODULE pydll; |
46 HMODULE pydll; |
46 void(__cdecl * Py_SetPythonHome)(TCHAR * home); |
47 void(__cdecl * Py_SetPythonHome)(TCHAR * home); |
47 int(__cdecl * Py_Main)(int argc, TCHAR *argv[]); |
48 int(__cdecl * Py_Main)(int argc, TCHAR *argv[]); |
|
49 |
|
50 #if PY_MAJOR_VERSION >= 3 |
|
51 Py_LegacyWindowsStdioFlag = 1; |
|
52 #endif |
48 |
53 |
49 if (GetModuleFileName(NULL, pyscript, _countof(pyscript)) == 0) { |
54 if (GetModuleFileName(NULL, pyscript, _countof(pyscript)) == 0) { |
50 err = "GetModuleFileName failed"; |
55 err = "GetModuleFileName failed"; |
51 goto bail; |
56 goto bail; |
52 } |
57 } |