Added settrace() and setprofile().

This commit is contained in:
Guido van Rossum 1992-03-23 18:20:18 +00:00
parent d510c786b8
commit e2437a191d
1 changed files with 30 additions and 13 deletions

View File

@ -42,20 +42,9 @@ Data members:
#include "sysmodule.h" #include "sysmodule.h"
#include "import.h" #include "import.h"
#include "modsupport.h" #include "modsupport.h"
#include "osdefs.h"
/* Define delimiter used in $PYTHONPATH */ object *sys_trace, *sys_profile;
#ifdef macintosh
#define DELIM ' '
#endif
#ifdef MSDOS
#define DELIM ';'
#endif
#ifndef DELIM
#define DELIM ':'
#endif
static object *sysdict; static object *sysdict;
@ -105,8 +94,36 @@ sys_exit(self, args)
return NULL; 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[] = { static struct methodlist sys_methods[] = {
{"exit", sys_exit}, {"exit", sys_exit},
{"setprofile", sys_setprofile},
{"settrace", sys_settrace},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };