Skip to content

bpo-29400: sys.settracestate. - #3236

Closed
gwk wants to merge 1 commit into
python:masterfrom
gwk:trace-inst
Closed

gwk wants to merge 1 commit into
python:masterfrom
gwk:trace-inst

Conversation

@gwk

@gwk gwk commented Aug 29, 2017 •

Copy link
Copy Markdown
Contributor

This patch adds a new pair of functions to sys: settracestate and gettracestate. The old settrace/gettrace pair are now equivalent to calling settracestate with trace_instructions=False; when set to True, the tracer callback is called for every bytecode instruction. This is useful for observing and instrumenting bytecode, e.g. for intraline code coverage. gettracestate returns a dictionary that completely represents the tracing state. The old gettrace now raises an exception if trace_instructions=True, because it is no longer capturing the complete state. This guards against subtle failure for existing code that uses the old = gettrace(); ... ; settrace(old) idiom.

https://bugs.python.org/issue29400

@gwk gwk changed the title bpo-24900: sys.settracestate. Aug 29, 2017
@gwk

gwk commented Sep 27, 2017

Copy link
Copy Markdown
Contributor Author

This work has been superseded by 5a85167.

@gwk gwk closed this Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants