Index: start.c =================================================================== RCS file: /cvsroot/py2exe/py2exe/source/start.c,v retrieving revision 1.20 diff -c -r1.20 start.c *** start.c 9 Jun 2004 06:28:31 -0000 1.20 --- start.c 21 Dec 2004 16:54:15 -0000 *************** *** 31,36 **** --- 31,40 ---- #include #include + #if defined(MS_WINDOWS) || defined(__CYGWIN__) + #include + #endif + struct scriptinfo { int tag; int optimize; *************** *** 142,151 **** else _putenv ("PYTHONVERBOSE="); ! if (p_script_info->unbuffered) ! _putenv ("PYTHONUNBUFFERED=1"); ! else ! _putenv ("PYTHONUNBUFFERED="); } Py_NoSiteFlag = 1; --- 146,167 ---- else _putenv ("PYTHONVERBOSE="); ! if (p_script_info->unbuffered) { ! #if defined(MS_WINDOWS) || defined(__CYGWIN__) ! _setmode(fileno(stdin), O_BINARY); ! _setmode(fileno(stdout), O_BINARY); ! #endif ! #ifdef HAVE_SETVBUF ! setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); ! setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); ! setvbuf(stderr, (char *)NULL, _IONBF, BUFSIZ); ! #else /* !HAVE_SETVBUF */ ! setbuf(stdin, (char *)NULL); ! setbuf(stdout, (char *)NULL); ! setbuf(stderr, (char *)NULL); ! #endif /* !HAVE_SETVBUF */ ! } ! } Py_NoSiteFlag = 1; *************** *** 181,187 **** /* Hm, actually it would be better to set them to values saved before changing them ;-) */ _putenv("PYTHONPATH="); - _putenv("PYTHONUNBUFFERED="); _putenv("PYTHONVERBOSE="); return 0; } --- 197,202 ----