]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Set sys.executable to full path of python (from argv[0]).
authorGuido van Rossum <guido@python.org>
Thu, 22 May 1997 20:41:20 +0000 (20:41 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 22 May 1997 20:41:20 +0000 (20:41 +0000)
Python/sysmodule.c

index a946b0d4d7d832afe856bcda7fd46031d3ef57be..3f9fc05a746a38b0bcf7f9e383b1e833217b63e4 100644 (file)
@@ -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);