From: Ronald Oussoren Date: Fri, 23 Jul 2010 16:05:35 +0000 (+0000) Subject: Ensure that sys.prefix can reliably be found X-Git-Tag: v3.2a1~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97d1119ddeb60e70c6a4be2080f6b71ca2004f72;p=thirdparty%2FPython%2Fcpython.git Ensure that sys.prefix can reliably be found on OSX. This fixes a small issue that was exposed by running test_subprocess through regrtest (and hence in a subdirectory). Without this patch running python.exe from the build tree will fail when these tree conditions are true: 1) the CWD is not the root of build tree 2) python.exe is found through $PATH 3) the framework is not yet installed --- diff --git a/Modules/getpath.c b/Modules/getpath.c index a5b01ed22829..4164a12ec40d 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -552,7 +552,7 @@ calculate_path(void) if (!ismodule(argv0_path)) { /* We are in the build directory so use the name of the executable - we know that the absolute path is passed */ - wcsncpy(argv0_path, prog, MAXPATHLEN); + wcsncpy(argv0_path, progpath, MAXPATHLEN); } else { /* Use the location of the library as the progpath */