Show More
@@ -7,6 +7,7 b'' | |||||
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> | |
@@ -46,6 +47,10 b' int _tmain(int argc, TCHAR *argv[])' | |||||
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[]); | |
48 |
|
49 | |||
|
50 | #if PY_MAJOR_VERSION >= 3 | |||
|
51 | Py_LegacyWindowsStdioFlag = 1; | |||
|
52 | #endif | |||
|
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; |
@@ -2640,6 +2640,10 b' class TestRunner(object):' | |||||
2640 | self._tmpbindir = self._bindir |
|
2640 | self._tmpbindir = self._bindir | |
2641 | self._pythondir = os.path.join(self._installdir, b"lib", b"python") |
|
2641 | self._pythondir = os.path.join(self._installdir, b"lib", b"python") | |
2642 |
|
2642 | |||
|
2643 | # Force the use of hg.exe instead of relying on MSYS to recognize hg is | |||
|
2644 | # a python script and feed it to python.exe. Legacy stdio is force | |||
|
2645 | # enabled by hg.exe, and this is a more realistic way to launch hg | |||
|
2646 | # anyway. | |||
2643 | if os.name == 'nt' and not self._hgcommand.endswith(b'.exe'): |
|
2647 | if os.name == 'nt' and not self._hgcommand.endswith(b'.exe'): | |
2644 | self._hgcommand += b'.exe' |
|
2648 | self._hgcommand += b'.exe' | |
2645 |
|
2649 |
General Comments 0
You need to be logged in to leave comments.
Login now