diff options
author | Guido van Rossum <guido@python.org> | 1996-06-17 17:02:48 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-06-17 17:02:48 (GMT) |
commit | 8fa9b6f93286faa0e51aa97f43f7b5231bb5955c (patch) | |
tree | fb95c0c61a4102266d2607028ab76fcaf47557da /Python/sysmodule.c | |
parent | 529c963d36bc9ff2876bc75a43ed4b729a1b4bec (diff) | |
download | cpython-8fa9b6f93286faa0e51aa97f43f7b5231bb5955c.zip cpython-8fa9b6f93286faa0e51aa97f43f7b5231bb5955c.tar.gz cpython-8fa9b6f93286faa0e51aa97f43f7b5231bb5955c.tar.bz2 |
Define sys.prefix and sys.exec_prefix (see Modules/getpath.c; from Makefile).
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 17a7852..615a18a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -235,6 +235,8 @@ initsys() extern char *getversion PROTO((void)); extern char *getcopyright PROTO((void)); extern char *getplatform PROTO((void)); + extern char *Py_GetPrefix PROTO((void)); + extern char *Py_GetExecPrefix PROTO((void)); extern int fclose PROTO((FILE *)); object *m = initmodule("sys", sys_methods); object *v; @@ -256,6 +258,11 @@ initsys() XDECREF(v); dictinsert(sysdict, "platform", v = newstringobject(getplatform())); XDECREF(v); + dictinsert(sysdict, "prefix", v = newstringobject(Py_GetPrefix())); + XDECREF(v); + dictinsert(sysdict, "exec_prefix", + v = newstringobject(Py_GetExecPrefix())); + XDECREF(v); dictinsert(sysdict, "maxint", v = newintobject(getmaxint())); XDECREF(v); dictinsert(sysdict, "modules", get_modules()); |