Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 710:bc5c77fa8006 legacy-trunk
Added settrace() and setprofile().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 23 Mar 1992 18:20:18 +0000 |
| parents | f5a2bc39e10e |
| children | ba4ec13c0f9f |
line wrap: on
line diff
--- a/Python/sysmodule.c Mon Mar 23 18:20:04 1992 +0000 +++ b/Python/sysmodule.c Mon Mar 23 18:20:18 1992 +0000 @@ -42,20 +42,9 @@ #include "sysmodule.h" #include "import.h" #include "modsupport.h" - -/* Define delimiter used in $PYTHONPATH */ - -#ifdef macintosh -#define DELIM ' ' -#endif +#include "osdefs.h" -#ifdef MSDOS -#define DELIM ';' -#endif - -#ifndef DELIM -#define DELIM ':' -#endif +object *sys_trace, *sys_profile; static object *sysdict; @@ -105,8 +94,36 @@ return NULL; } +static object * +sys_settrace(self, args) + object *self; + object *args; +{ + if (args == None) + args = NULL; + XINCREF(args); + sys_trace = args; + INCREF(None); + return None; +} + +static object * +sys_setprofile(self, args) + object *self; + object *args; +{ + if (args == None) + args = NULL; + XINCREF(args); + sys_profile = args; + INCREF(None); + return None; +} + static struct methodlist sys_methods[] = { {"exit", sys_exit}, + {"setprofile", sys_setprofile}, + {"settrace", sys_settrace}, {NULL, NULL} /* sentinel */ };
