--- 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;