Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Parser/intrcheck.c

    r2 r388  
    2222PyOS_InterruptOccurred(void)
    2323{
    24         _wyield();
     24    _wyield();
    2525}
    2626
     
    4848PyOS_InitInterrupts(void)
    4949{
    50         _go32_want_ctrl_break(1 /* TRUE */);
     50    _go32_want_ctrl_break(1 /* TRUE */);
    5151}
    5252
     
    5959PyOS_InterruptOccurred(void)
    6060{
    61         return _go32_was_ctrl_break_hit();
     61    return _go32_was_ctrl_break_hit();
    6262}
    6363
     
    7979PyOS_InterruptOccurred(void)
    8080{
    81         int interrupted = 0;
    82         while (kbhit()) {
    83                 if (getch() == '\003')
    84                         interrupted = 1;
    85         }
    86         return interrupted;
     81    int interrupted = 0;
     82    while (kbhit()) {
     83        if (getch() == '\003')
     84            interrupted = 1;
     85    }
     86    return interrupted;
    8787}
    8888
     
    107107PyErr_SetInterrupt(void)
    108108{
    109         interrupted = 1;
     109    interrupted = 1;
    110110}
    111111
     
    115115checksignals_witharg(void * arg)
    116116{
    117         return PyErr_CheckSignals();
     117    return PyErr_CheckSignals();
    118118}
    119119
     
    121121intcatcher(int sig)
    122122{
    123         extern void Py_Exit(int);
    124         static char message[] =
     123    extern void Py_Exit(int);
     124    static char message[] =
    125125"python: to interrupt a truly hanging Python program, interrupt once more.\n";
    126         switch (interrupted++) {
    127         case 0:
    128                 break;
    129         case 1:
     126    switch (interrupted++) {
     127    case 0:
     128        break;
     129    case 1:
    130130#ifdef RISCOS
    131                 fprintf(stderr, message);
     131        fprintf(stderr, message);
    132132#else
    133                 write(2, message, strlen(message));
     133        write(2, message, strlen(message));
    134134#endif
    135                 break;
    136         case 2:
    137                 interrupted = 0;
    138                 Py_Exit(1);
    139                 break;
    140         }
    141         PyOS_setsig(SIGINT, intcatcher);
    142         Py_AddPendingCall(checksignals_witharg, NULL);
     135        break;
     136    case 2:
     137        interrupted = 0;
     138        Py_Exit(1);
     139        break;
     140    }
     141    PyOS_setsig(SIGINT, intcatcher);
     142    Py_AddPendingCall(checksignals_witharg, NULL);
    143143}
    144144
     
    148148PyOS_InitInterrupts(void)
    149149{
    150         if ((old_siginthandler = PyOS_setsig(SIGINT, SIG_IGN)) != SIG_IGN)
    151                 PyOS_setsig(SIGINT, intcatcher);
     150    if ((old_siginthandler = PyOS_setsig(SIGINT, SIG_IGN)) != SIG_IGN)
     151        PyOS_setsig(SIGINT, intcatcher);
    152152}
    153153
     
    155155PyOS_FiniInterrupts(void)
    156156{
    157         PyOS_setsig(SIGINT, old_siginthandler);
     157    PyOS_setsig(SIGINT, old_siginthandler);
    158158}
    159159
     
    161161PyOS_InterruptOccurred(void)
    162162{
    163         if (!interrupted)
    164                 return 0;
    165         interrupted = 0;
    166         return 1;
     163    if (!interrupted)
     164        return 0;
     165    interrupted = 0;
     166    return 1;
    167167}
    168168
     
    173173{
    174174#ifdef WITH_THREAD
    175         PyEval_ReInitThreads();
    176         PyThread_ReInitTLS();
     175    PyEval_ReInitThreads();
     176    PyThread_ReInitTLS();
    177177#endif
    178178}
Note: See TracChangeset for help on using the changeset viewer.