diff Python/sysmodule.c @ 5598:1f206c91daee legacy-trunk

Set sys.executable to full path of python (from argv[0]).
author Guido van Rossum <guido@python.org>
date Thu, 22 May 1997 20:41:20 +0000
parents 43822e4fc27d
children 0ac2c747053f
line wrap: on
line diff
--- a/Python/sysmodule.c	Thu May 22 20:36:45 1997 +0000
+++ b/Python/sysmodule.c	Thu May 22 20:41:20 1997 +0000
@@ -278,6 +278,7 @@
 	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 @@
 	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);