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/RISCOS/Modules/getpath_riscos.c

    r2 r391  
    66static void
    77calculate_path()
    8 { 
    9         char *pypath = getenv("Python$Path");
    10         if (pypath) {
    11                 int pathlen = strlen(pypath);
    12                 module_search_path = malloc(pathlen + 1);
    13                 if (module_search_path)
    14                         strncpy(module_search_path, pypath, pathlen + 1);
    15                 else {
    16                         fprintf(stderr,
    17                                 "Not enough memory for dynamic PYTHONPATH.\n"
    18                                 "Using default static PYTHONPATH.\n");
    19                 }
    20         }
    21         if (!module_search_path)
    22                 module_search_path = "<Python$Dir>.Lib";
    23         prefix = "<Python$Dir>";
    24         exec_prefix = prefix;
    25         progpath = Py_GetProgramName();
     8{
     9    char *pypath = getenv("Python$Path");
     10    if (pypath) {
     11        int pathlen = strlen(pypath);
     12        module_search_path = malloc(pathlen + 1);
     13        if (module_search_path)
     14            strncpy(module_search_path, pypath, pathlen + 1);
     15        else {
     16            fprintf(stderr,
     17                "Not enough memory for dynamic PYTHONPATH.\n"
     18                "Using default static PYTHONPATH.\n");
     19        }
     20    }
     21    if (!module_search_path)
     22        module_search_path = "<Python$Dir>.Lib";
     23    prefix = "<Python$Dir>";
     24    exec_prefix = prefix;
     25    progpath = Py_GetProgramName();
    2626}
    2727
     
    3131Py_GetPath()
    3232{
    33         if (!module_search_path)
    34                 calculate_path();
    35         return module_search_path;
     33    if (!module_search_path)
     34        calculate_path();
     35    return module_search_path;
    3636}
    3737
     
    3939Py_GetPrefix()
    4040{
    41         if (!module_search_path)
    42                 calculate_path();
    43         return prefix;
     41    if (!module_search_path)
     42        calculate_path();
     43    return prefix;
    4444}
    4545
     
    4747Py_GetExecPrefix()
    4848{
    49         if (!module_search_path)
    50                 calculate_path();
    51         return exec_prefix;
     49    if (!module_search_path)
     50        calculate_path();
     51    return exec_prefix;
    5252}
    5353
     
    5555Py_GetProgramFullPath()
    5656{
    57         if (!module_search_path)
    58                 calculate_path();
    59         return progpath;
     57    if (!module_search_path)
     58        calculate_path();
     59    return progpath;
    6060}
Note: See TracChangeset for help on using the changeset viewer.