summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-02-06 22:29:30 (GMT)
committerGuido van Rossum <guido@python.org>1998-02-06 22:29:30 (GMT)
commit131c92c069d07f01b9492522f257e7668f32631e (patch)
tree458f3160f8b517e76f40d7d96626f7ab7afeddfa
parent66d4b9079117ba1496ca08e8c1be22626b3bc89a (diff)
downloadcpython-131c92c069d07f01b9492522f257e7668f32631e.zip
cpython-131c92c069d07f01b9492522f257e7668f32631e.tar.gz
cpython-131c92c069d07f01b9492522f257e7668f32631e.tar.bz2
- Use Py_GetPythonHome() instead of getenv("PYTHONHOME").
- Don't print error messages when Py_FrozenFlag is set.
-rw-r--r--Modules/getpath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 88daadc..589b7ae 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -385,7 +385,7 @@ calculate_path()
static char separator[2] = {SEP, '\0'};
char *pythonpath = PYTHONPATH;
char *rtpypath = getenv("PYTHONPATH");
- char *home = getenv("PYTHONHOME");
+ char *home = Py_GetPythonHome();
char *path = getenv("PATH");
char *prog = Py_GetProgramName();
char argv0_path[MAXPATHLEN+1];
@@ -454,6 +454,7 @@ calculate_path()
reduce(argv0_path);
if (!(pfound = search_for_prefix(argv0_path, home))) {
+ if (!Py_FrozenFlag)
fprintf(stderr,
"Could not find platform independent libraries <prefix>\n");
strcpy(prefix, PREFIX);
@@ -463,6 +464,7 @@ calculate_path()
reduce(prefix);
if (!(efound = search_for_exec_prefix(argv0_path, home))) {
+ if (!Py_FrozenFlag)
fprintf(stderr,
"Could not find platform dependent libraries <exec_prefix>\n");
strcpy(exec_prefix, EXEC_PREFIX);
@@ -470,7 +472,7 @@ calculate_path()
}
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
- if (!pfound || !efound)
+ if ((!pfound || !efound) && !Py_FrozenFlag)
fprintf(stderr,
"Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]\n");