From: Guido van Rossum Date: Thu, 22 May 1997 20:41:20 +0000 (+0000) Subject: Set sys.executable to full path of python (from argv[0]). X-Git-Tag: v1.5a3~480 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2c8ec4b75f9842042d0ca4ce19102580eafd373;p=thirdparty%2FPython%2Fcpython.git Set sys.executable to full path of python (from argv[0]). --- diff --git a/Python/sysmodule.c b/Python/sysmodule.c index a946b0d4d7d8..3f9fc05a746a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -278,6 +278,7 @@ PySys_Init() extern char *Py_GetVersion Py_PROTO((void)); extern char *Py_GetCopyright Py_PROTO((void)); extern char *Py_GetPlatform Py_PROTO((void)); + extern char *Py_GetProgramFullPath Py_PROTO((void)); extern char *Py_GetPrefix Py_PROTO((void)); extern char *Py_GetExecPrefix Py_PROTO((void)); extern int fclose Py_PROTO((FILE *)); @@ -304,6 +305,9 @@ PySys_Init() PyDict_SetItemString(sysdict, "platform", v = PyString_FromString(Py_GetPlatform())); Py_XDECREF(v); + PyDict_SetItemString(sysdict, "executable", + v = PyString_FromString(Py_GetProgramFullPath())); + Py_XDECREF(v); PyDict_SetItemString(sysdict, "prefix", v = PyString_FromString(Py_GetPrefix())); Py_XDECREF(v);