mirror of https://github.com/python/cpython.git
added sys.platform
This commit is contained in:
parent
e40bddc3ef
commit
aaf18390ee
|
@ -194,6 +194,7 @@ initsys()
|
|||
extern long getmaxint PROTO((void));
|
||||
extern char *getversion PROTO((void));
|
||||
extern char *getcopyright PROTO((void));
|
||||
extern char *getplatform PROTO((void));
|
||||
extern int fclose PROTO((FILE *));
|
||||
object *m = initmodule("sys", sys_methods);
|
||||
object *v;
|
||||
|
@ -213,6 +214,8 @@ initsys()
|
|||
XDECREF(v);
|
||||
dictinsert(sysdict, "copyright", v = newstringobject(getcopyright()));
|
||||
XDECREF(v);
|
||||
dictinsert(sysdict, "platform", v = newstringobject(getplatform()));
|
||||
XDECREF(v);
|
||||
dictinsert(sysdict, "maxint", v = newintobject(getmaxint()));
|
||||
XDECREF(v);
|
||||
dictinsert(sysdict, "modules", get_modules());
|
||||
|
|
Loading…
Reference in New Issue