summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-22 20:41:20 +0000
committerGuido van Rossum <guido@python.org>1997-05-22 20:41:20 +0000
commit1d92b4b602f8004569bc729cc378e719ce488a2c (patch)
treea4fa57158ffd54fe877d102e10062563f78b409e /Python/sysmodule.c
parent8026eb0bbe85801ab26dd6862b21c4edabc2e2de (diff)
downloadcpython-1d92b4b602f8004569bc729cc378e719ce488a2c.tar.gz
Set sys.executable to full path of python (from argv[0]).
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index a946b0d4d7..3f9fc05a74 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);