mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Set sys.executable to full path of python (from argv[0]).
This commit is contained in:
parent
9726690478
commit
b2c8ec4b75
1 changed files with 4 additions and 0 deletions
|
@ -278,6 +278,7 @@ PySys_Init()
|
||||||
extern char *Py_GetVersion Py_PROTO((void));
|
extern char *Py_GetVersion Py_PROTO((void));
|
||||||
extern char *Py_GetCopyright Py_PROTO((void));
|
extern char *Py_GetCopyright Py_PROTO((void));
|
||||||
extern char *Py_GetPlatform 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_GetPrefix Py_PROTO((void));
|
||||||
extern char *Py_GetExecPrefix Py_PROTO((void));
|
extern char *Py_GetExecPrefix Py_PROTO((void));
|
||||||
extern int fclose Py_PROTO((FILE *));
|
extern int fclose Py_PROTO((FILE *));
|
||||||
|
@ -304,6 +305,9 @@ PySys_Init()
|
||||||
PyDict_SetItemString(sysdict, "platform",
|
PyDict_SetItemString(sysdict, "platform",
|
||||||
v = PyString_FromString(Py_GetPlatform()));
|
v = PyString_FromString(Py_GetPlatform()));
|
||||||
Py_XDECREF(v);
|
Py_XDECREF(v);
|
||||||
|
PyDict_SetItemString(sysdict, "executable",
|
||||||
|
v = PyString_FromString(Py_GetProgramFullPath()));
|
||||||
|
Py_XDECREF(v);
|
||||||
PyDict_SetItemString(sysdict, "prefix",
|
PyDict_SetItemString(sysdict, "prefix",
|
||||||
v = PyString_FromString(Py_GetPrefix()));
|
v = PyString_FromString(Py_GetPrefix()));
|
||||||
Py_XDECREF(v);
|
Py_XDECREF(v);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue