mercurial/exewrapper.c
changeset 40976 ef7119cd4965
parent 40416 36ba91e06948
child 47315 825d5a5907b4
--- a/mercurial/exewrapper.c	Sun Dec 16 17:36:51 2018 -0500
+++ b/mercurial/exewrapper.c	Sun Dec 16 17:42:45 2018 -0500
@@ -7,6 +7,7 @@
  GNU General Public License version 2 or any later version.
 */
 
+#include <Python.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <windows.h>
@@ -46,6 +47,10 @@
 	void(__cdecl * Py_SetPythonHome)(TCHAR * home);
 	int(__cdecl * Py_Main)(int argc, TCHAR *argv[]);
 
+#if PY_MAJOR_VERSION >= 3
+	Py_LegacyWindowsStdioFlag = 1;
+#endif
+
 	if (GetModuleFileName(NULL, pyscript, _countof(pyscript)) == 0) {
 		err = "GetModuleFileName failed";
 		goto bail;