Commits

Guido van Rossum  committed a4a268b

Alas, get rid of the Win specific hack to ask the user to press Return
before exiting when an error happened. This didn't work right when
Python is invoked from a daemon.

  • Participants
  • Parent commits 32ba09c
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Python/pythonrun.c

 
 */
 
-extern void win_pre_init(), win_pre_exit();
 void
 Py_Initialize()
 {
 	if (initialized)
 		return;
 	initialized = 1;
-#ifdef MS_WINDOWS
-	win_pre_init();
-#endif
 	
 	if ((p = getenv("PYTHONDEBUG")) && *p != '\0')
 		Py_DebugFlag = 1;
 #ifdef macintosh
 	PyMac_Exit(sts);
 #else
-#ifdef MS_WINDOWS
-	win_pre_exit(sts);
-#endif
 	exit(sts);
 #endif
 }
 	       (strcmp(filename, "<stdin>") == 0) ||
 	       (strcmp(filename, "???") == 0);
 }
-
-#ifdef MS_WINDOWS
-
-#include <windows.h>
-#include <conio.h>
-
-static int its_my_console = -1;
-
-static void
-win_pre_init()
-{
-	HANDLE console;
-	CONSOLE_SCREEN_BUFFER_INFO info;
-	if (its_my_console >= 0)
-		return;
-	its_my_console = 0;
-	console = GetStdHandle(STD_OUTPUT_HANDLE);
-	if (console == INVALID_HANDLE_VALUE)
-		return;
-	if (!GetConsoleScreenBufferInfo(console, &info)) {
-		return;
-	}
-	if (info.dwCursorPosition.Y == 0)
-		its_my_console = 1;
-}
-
-static void
-win_pre_exit(sts)
-	int sts;
-{
-	if (sts == 0)
-		return;
-	if (its_my_console <= 0)
-		return;
-	fprintf(stderr, "Hit any key to exit...");
-	fflush(stderr);
-	_getch();
-}
-
-#endif