summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-11-12 16:22:24 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-11-12 16:22:24 -0500
commita3cb2f42aae5392c1a957e6522b0339733ec66cc (patch)
tree9ad00be935564d49d08ac7347b31c19a0575df49 /coverage
parentd101c6c7c2f0a4ac6b95c2205e877a108f410a31 (diff)
downloadpython-coveragepy-git-a3cb2f42aae5392c1a957e6522b0339733ec66cc.tar.gz
Allow for the possibility of null-testing
Diffstat (limited to 'coverage')
-rw-r--r--coverage/ctracer/tracer.c8
-rw-r--r--coverage/ctracer/util.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c
index ac16b6b5..bfaa74ea 100644
--- a/coverage/ctracer/tracer.c
+++ b/coverage/ctracer/tracer.c
@@ -824,6 +824,10 @@ CTracer_trace(CTracer *self, PyFrameObject *frame, int what, PyObject *arg_unuse
{
int ret = RET_ERROR;
+ #if DO_NOTHING
+ return RET_OK;
+ #endif
+
#if WHAT_LOG || TRACE_LOG
PyObject * ascii = NULL;
#endif
@@ -922,6 +926,10 @@ CTracer_call(CTracer *self, PyObject *args, PyObject *kwds)
PyObject *ret = NULL;
PyObject * ascii = NULL;
+ #if DO_NOTHING
+ CRASH
+ #endif
+
static char *what_names[] = {
"call", "exception", "line", "return",
"c_call", "c_exception", "c_return",
diff --git a/coverage/ctracer/util.h b/coverage/ctracer/util.h
index 678eb6c2..e192f977 100644
--- a/coverage/ctracer/util.h
+++ b/coverage/ctracer/util.h
@@ -10,6 +10,7 @@
#undef WHAT_LOG /* Define to log the WHAT params in the trace function. */
#undef TRACE_LOG /* Define to log our bookkeeping. */
#undef COLLECT_STATS /* Collect counters: stats are printed when tracer is stopped. */
+#undef DO_NOTHING /* Define this to make the tracer do nothing. */
/* Py 2.x and 3.x compatibility */