Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2437a1

Browse files
committed
Added settrace() and setprofile().
1 parent d510c78 commit e2437a1

1 file changed

Lines changed: 30 additions & 13 deletions

File tree

Python/sysmodule.c

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,9 @@ Data members:
4242
#include "sysmodule.h"
4343
#include "import.h"
4444
#include "modsupport.h"
45+
#include "osdefs.h"
4546

46-
/* Define delimiter used in $PYTHONPATH */
47-
48-
#ifdef macintosh
49-
#define DELIM ' '
50-
#endif
51-
52-
#ifdef MSDOS
53-
#define DELIM ';'
54-
#endif
55-
56-
#ifndef DELIM
57-
#define DELIM ':'
58-
#endif
47+
object *sys_trace, *sys_profile;
5948

6049
static object *sysdict;
6150

@@ -105,8 +94,36 @@ sys_exit(self, args)
10594
return NULL;
10695
}
10796

97+
static object *
98+
sys_settrace(self, args)
99+
object *self;
100+
object *args;
101+
{
102+
if (args == None)
103+
args = NULL;
104+
XINCREF(args);
105+
sys_trace = args;
106+
INCREF(None);
107+
return None;
108+
}
109+
110+
static object *
111+
sys_setprofile(self, args)
112+
object *self;
113+
object *args;
114+
{
115+
if (args == None)
116+
args = NULL;
117+
XINCREF(args);
118+
sys_profile = args;
119+
INCREF(None);
120+
return None;
121+
}
122+
108123
static struct methodlist sys_methods[] = {
109124
{"exit", sys_exit},
125+
{"setprofile", sys_setprofile},
126+
{"settrace", sys_settrace},
110127
{NULL, NULL} /* sentinel */
111128
};
112129

0 commit comments

Comments
 (0)