summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-07-17 18:54:20 (GMT)
committerFred Drake <fdrake@acm.org>2002-07-17 18:54:20 (GMT)
commitd1eb8b61d01c6426e2fedf952ab6b9dbef42d7a9 (patch)
treedcb2c59a99f61b7b4f249213256bdb804f4d4704 /Modules
parent04e7032c6e7626741a8f211fe2494577420fe2df (diff)
downloadcpython-d1eb8b61d01c6426e2fedf952ab6b9dbef42d7a9.zip
cpython-d1eb8b61d01c6426e2fedf952ab6b9dbef42d7a9.tar.gz
cpython-d1eb8b61d01c6426e2fedf952ab6b9dbef42d7a9.tar.bz2
Added a docstring for the closed attribute.
write_header(): When we encounter a non-string object in sys.path, record a fairly mindless placeholder rather than dying. Possibly could record the repr of the object found, but not clear whether that matters.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_hotshot.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 4a0fbd8..32137b2 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -1180,7 +1180,8 @@ profiler_get_closed(ProfilerObject *self, void *closure)
}
static PyGetSetDef profiler_getsets[] = {
- {"closed", (getter)profiler_get_closed, NULL},
+ {"closed", (getter)profiler_get_closed, NULL,
+ "True if the profiler's output file has already been closed."},
{NULL}
};
@@ -1437,9 +1438,13 @@ write_header(ProfilerObject *self)
for (i = 0; i < len; ++i) {
PyObject *item = PyList_GET_ITEM(temp, i);
buffer = PyString_AsString(item);
- if (buffer == NULL)
- return -1;
- pack_add_info(self, "sys-path-entry", buffer);
+ if (buffer == NULL) {
+ pack_add_info(self, "sys-path-entry", "<non-string-path-entry>");
+ PyErr_Clear();
+ }
+ else {
+ pack_add_info(self, "sys-path-entry", buffer);
+ }
}
pack_frame_times(self);
pack_line_times(self);