? Mac/IDE scripts/Hold option to open a script ? Mac/IDE scripts/Insert file name ? Mac/IDE scripts/Insert folder name ? Mac/IDE scripts/Search Python Documentation ? Mac/IDE scripts/Hack/Remove .pyc files ? Mac/IDE scripts/Hack/Toolbox Assistant ? Parser/myreadline.c.20050610.diff Index: Parser/myreadline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/myreadline.c,v retrieving revision 2.34 diff -c -r2.34 myreadline.c *** Parser/myreadline.c 7 Apr 2005 10:11:18 -0000 2.34 --- Parser/myreadline.c 29 Jul 2005 01:09:11 -0000 *************** *** 13,18 **** --- 13,19 ---- #ifdef MS_WINDOWS #define WIN32_LEAN_AND_MEAN #include "windows.h" + #include "conio.h" #endif /* MS_WINDOWS */ #ifdef __VMS *************** *** 41,52 **** { char *p; for (;;) { ! if (PyOS_InputHook != NULL) ! (void)(PyOS_InputHook)(); errno = 0; ! p = fgets(buf, len, fp); ! if (p != NULL) ! return 0; /* No error */ #ifdef MS_WINDOWS /* In the case of a Ctrl+C or some other external event interrupting the operation: --- 42,93 ---- { char *p; for (;;) { ! int has_input = 0; ! int fn = fileno(fp); ! #ifdef MS_WINDOWS ! HANDLE hStdIn = (HANDLE) _get_osfhandle(fn); ! int wait_for_kbhit = _isatty(fn); ! ! errno = 0; ! ! while (!has_input) { ! DWORD timeout = 100; /* 100 milliseconds */ ! DWORD result; ! if (PyOS_InputHook) PyOS_InputHook(); ! result = WaitForSingleObject(hStdIn, timeout); ! if (result==WAIT_OBJECT_0) { ! if (!wait_for_kbhit || _kbhit()) has_input = 1; ! /* _kbhit returns nonzero if a keystroke is ! * waiting in the console buffer. Since ! * WaitForSingleObject returns WAIT_OBJECT_0 ! * in case of both keyboard events and mouse ! * events, we need to check explicitly if ! * a keystrole is available. */ ! } ! } ! #else ! fd_set selectset; errno = 0; ! ! FD_ZERO(&selectset); ! ! while (!has_input) { ! struct timeval timeout = {0, 100000}; ! /* 100000 microseconds */ ! FD_SET(fn, &selectset); ! if (PyOS_InputHook) PyOS_InputHook(); ! /* select resets selectset if no input was available */ ! has_input = select(fn+1, &selectset, ! NULL, NULL, &timeout); ! } ! #endif ! ! if (has_input > 0) { ! p = fgets(buf, len, fp); ! if (p != NULL) ! return 0; /* No error */ ! } ! #ifdef MS_WINDOWS /* In the case of a Ctrl+C or some other external event interrupting the operation: