Skip to content

bpo-29400: sys.settracestate.#3236

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

bpo-29400: sys.settracestate.#3236
gwk wants to merge 1 commit intopython:masterfrom
gwk:trace-inst

Conversation

@gwk
Copy link
Contributor

@gwk gwk commented Aug 29, 2017

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. bpo-29400: sys.settracestate. Aug 29, 2017
@gwk
Copy link
Contributor Author

gwk commented Sep 27, 2017

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants