summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2018-01-27 15:04:47 (GMT)
committerGitHub <noreply@github.com>2018-01-27 15:04:47 (GMT)
commit60da99b8e2f7bf497569ae4d6c218866575729bf (patch)
tree0678b2c453726f5c0c6d76947178862a6c3442e7 /Doc
parent61d478c71c5341cdc54e6bfb4ace4252852fd972 (diff)
downloadcpython-60da99b8e2f7bf497569ae4d6c218866575729bf.zip
cpython-60da99b8e2f7bf497569ae4d6c218866575729bf.tar.gz
cpython-60da99b8e2f7bf497569ae4d6c218866575729bf.tar.bz2
bpo-32532: Improve documentation of settrace and setprofile (#5359)
Mention in the documentation of settrace and setprofile that errors in the registered handlers will cause themselves unset.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/sys.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index ab08f61..67925e4 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -1089,7 +1089,8 @@ always available.
but the return event is reported even when an exception has been set). The function is
thread-specific, but there is no way for the profiler to know about context switches between
threads, so it does not make sense to use this in the presence of multiple threads. Also,
- its return value is not used, so it can simply return ``None``.
+ its return value is not used, so it can simply return ``None``. Error in the profile
+ function will cause itself unset.
Profile functions should have three arguments: *frame*, *event*, and
*arg*. *frame* is the current stack frame. *event* is a string: ``'call'``,
@@ -1173,6 +1174,9 @@ always available.
function for further tracing in that scope), or ``None`` to turn off tracing
in that scope.
+ If there is any error occurred in the trace function, it will be unset, just
+ like ``settrace(None)`` is called.
+
The events have the following meaning:
``'call'``