Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Demo/embed/loop.c

    r2 r391  
    77main(int argc, char **argv)
    88{
    9         int count = -1;
    10         char *command;
     9    int count = -1;
     10    char *command;
    1111
    12         if (argc < 2 || argc > 3) {
    13                 fprintf(stderr, "usage: loop <python-command> [count]\n");
    14                 exit(2);
    15         }
    16         command = argv[1];
     12    if (argc < 2 || argc > 3) {
     13        fprintf(stderr, "usage: loop <python-command> [count]\n");
     14        exit(2);
     15    }
     16    command = argv[1];
    1717
    18         if (argc == 3) {
    19                 count = atoi(argv[2]);
    20         }
     18    if (argc == 3) {
     19        count = atoi(argv[2]);
     20    }
    2121
    22         Py_SetProgramName(argv[0]);
     22    Py_SetProgramName(argv[0]);
    2323
    24         /* uncomment this if you don't want to load site.py */
    25         /* Py_NoSiteFlag = 1; */
     24    /* uncomment this if you don't want to load site.py */
     25    /* Py_NoSiteFlag = 1; */
    2626
    27         while (count == -1 || --count >= 0 ) {
    28                 Py_Initialize();
    29                 PyRun_SimpleString(command);
    30                 Py_Finalize();
    31         }
    32         return 0;
     27    while (count == -1 || --count >= 0 ) {
     28        Py_Initialize();
     29        PyRun_SimpleString(command);
     30        Py_Finalize();
     31    }
     32    return 0;
    3333}
Note: See TracChangeset for help on using the changeset viewer.