Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 5597:5516915ffee7 | 5598:1f206c91daee |
|---|---|
| 276 { | 276 { |
| 277 extern long PyInt_GetMax Py_PROTO((void)); | 277 extern long PyInt_GetMax Py_PROTO((void)); |
| 278 extern char *Py_GetVersion Py_PROTO((void)); | 278 extern char *Py_GetVersion Py_PROTO((void)); |
| 279 extern char *Py_GetCopyright Py_PROTO((void)); | 279 extern char *Py_GetCopyright Py_PROTO((void)); |
| 280 extern char *Py_GetPlatform Py_PROTO((void)); | 280 extern char *Py_GetPlatform Py_PROTO((void)); |
| 281 extern char *Py_GetProgramFullPath Py_PROTO((void)); | |
| 281 extern char *Py_GetPrefix Py_PROTO((void)); | 282 extern char *Py_GetPrefix Py_PROTO((void)); |
| 282 extern char *Py_GetExecPrefix Py_PROTO((void)); | 283 extern char *Py_GetExecPrefix Py_PROTO((void)); |
| 283 extern int fclose Py_PROTO((FILE *)); | 284 extern int fclose Py_PROTO((FILE *)); |
| 284 PyObject *m = Py_InitModule("sys", sys_methods); | 285 PyObject *m = Py_InitModule("sys", sys_methods); |
| 285 PyObject *v; | 286 PyObject *v; |
| 301 PyDict_SetItemString(sysdict, "copyright", | 302 PyDict_SetItemString(sysdict, "copyright", |
| 302 v = PyString_FromString(Py_GetCopyright())); | 303 v = PyString_FromString(Py_GetCopyright())); |
| 303 Py_XDECREF(v); | 304 Py_XDECREF(v); |
| 304 PyDict_SetItemString(sysdict, "platform", | 305 PyDict_SetItemString(sysdict, "platform", |
| 305 v = PyString_FromString(Py_GetPlatform())); | 306 v = PyString_FromString(Py_GetPlatform())); |
| 307 Py_XDECREF(v); | |
| 308 PyDict_SetItemString(sysdict, "executable", | |
| 309 v = PyString_FromString(Py_GetProgramFullPath())); | |
| 306 Py_XDECREF(v); | 310 Py_XDECREF(v); |
| 307 PyDict_SetItemString(sysdict, "prefix", | 311 PyDict_SetItemString(sysdict, "prefix", |
| 308 v = PyString_FromString(Py_GetPrefix())); | 312 v = PyString_FromString(Py_GetPrefix())); |
| 309 Py_XDECREF(v); | 313 Py_XDECREF(v); |
| 310 PyDict_SetItemString(sysdict, "exec_prefix", | 314 PyDict_SetItemString(sysdict, "exec_prefix", |
