Changeset 391 for python/trunk/RISCOS/Modules/getpath_riscos.c
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/RISCOS/Modules/getpath_riscos.c
r2 r391 6 6 static void 7 7 calculate_path() 8 { 9 10 11 12 13 if (module_search_path) 14 15 16 fprintf(stderr, 17 18 19 20 21 if (!module_search_path) 22 23 24 25 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(); 26 26 } 27 27 … … 31 31 Py_GetPath() 32 32 { 33 34 35 33 if (!module_search_path) 34 calculate_path(); 35 return module_search_path; 36 36 } 37 37 … … 39 39 Py_GetPrefix() 40 40 { 41 42 43 41 if (!module_search_path) 42 calculate_path(); 43 return prefix; 44 44 } 45 45 … … 47 47 Py_GetExecPrefix() 48 48 { 49 50 51 49 if (!module_search_path) 50 calculate_path(); 51 return exec_prefix; 52 52 } 53 53 … … 55 55 Py_GetProgramFullPath() 56 56 { 57 58 59 57 if (!module_search_path) 58 calculate_path(); 59 return progpath; 60 60 }
Note:
See TracChangeset
for help on using the changeset viewer.