summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-03-23 18:20:18 (GMT)
committerGuido van Rossum <guido@python.org>1992-03-23 18:20:18 (GMT)
commite2437a191d1498f12cbb6906dfbe4e79c38271ad (patch)
tree7cd9d9a52027609369986a1aa6cf053b3de6f6fb /Python
parentd510c786b8e99e03b3d9a8067c90a248a54b1256 (diff)
downloadcpython-e2437a191d1498f12cbb6906dfbe4e79c38271ad.zip
cpython-e2437a191d1498f12cbb6906dfbe4e79c38271ad.tar.gz
cpython-e2437a191d1498f12cbb6906dfbe4e79c38271ad.tar.bz2
Added settrace() and setprofile().
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 7089fc7..8b99e27 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -42,20 +42,9 @@ Data members:
#include "sysmodule.h"
#include "import.h"
#include "modsupport.h"
+#include "osdefs.h"
-/* Define delimiter used in $PYTHONPATH */
-
-#ifdef macintosh
-#define DELIM ' '
-#endif
-
-#ifdef MSDOS
-#define DELIM ';'
-#endif
-
-#ifndef DELIM
-#define DELIM ':'
-#endif
+object *sys_trace, *sys_profile;
static object *sysdict;
@@ -105,8 +94,36 @@ sys_exit(self, args)
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 */
};