summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys_settrace.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to ↵Mark Shannon2021-08-091-0/+23
| | | | | after CFG optimization. (GH-27656) (#27673) (cherry picked from commit b854557b49083d8625a433eb36aacb0c87d67c52)
* bpo-44626: Merge basic blocks earlier to enable better handling of exit ↵Mark Shannon2021-07-161-3/+18
| | | | | blocks without line numbers (GH-27138) (GH-27182) (cherry picked from commit a86f7dae0acf918d54086cb85e5a0b0bedeedce7)
* bpo-44616: Mark all clean up instructions at end of named exception block as ↵Mark Shannon2021-07-141-0/+23
| | | | | artificial (GH-27109) (GH-27135) (cherry picked from commit e5862f79c16e28f1ec51d179698739a9b2d8c1d2)
* bpo-44570: Fix line tracing for forward jumps to duplicated tails (GH-27067)Mark Shannon2021-07-081-0/+35
|
* [3.10] bpo-44298: Backport #26513 to 3.10 (#26516)Mark Shannon2021-06-031-0/+46
| | | | | * Backport 937cebc93 to 3.10 * Update importlib
* [3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26061)Mark Shannon2021-05-131-0/+21
| | | * Guarantee that line number is set for returns.
* bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719)Mark Shannon2021-04-301-1/+2
| | | * Set line number of __exit__ call in a with statement to be that of the with keyword.
* Mark instructions at end of class scope as artificial. (GH-24222)Mark Shannon2021-01-151-0/+18
|
* bpo-42908: Mark cleanup code at end of try-except and with artificial (#24202)Mark Shannon2021-01-131-0/+40
| | | | | | | | | * Mark bytecodes at end of try-except as artificial. * Make sure that the CFG is consistent throughout optimiization. * Extend line-number propagation logic so that implicit returns after 'try-except' or 'with' have the correct line numbers. * Update importlib
* bpo-42810: Mark jumps at end of if and try statements as artificial. (GH-24091)Mark Shannon2021-01-041-0/+42
| | | | | | | * Mark jumps at end of if and try statements as artificial. * Update importlib * Add comment explaining the purpose of ADDOP_JUMP_NOLINE.
* bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)Mark Shannon2020-12-231-0/+64
|
* bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)Mark Shannon2020-12-211-0/+19
| | | | | | | * Mark reraise after except blocks as artificial. * Update importlib * Update dis test.
* bpo-42645: Make sure that return/break/continue are only traced once when ↵Mark Shannon2020-12-161-0/+113
| | | | | | | | | exiting via a finally block. (GH-23780) * Make sure that return/break/continue are only traced once when exiting via a finally block. * Add test for return in try-finally. * Update importlib
* bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if ↵Mark Shannon2020-12-151-3/+9
| | | | statements conform to PEP 626. (GH-23743)
* bpo-42635: Mark JUMP_ABSOLUTE at end of 'for' loop as artificial to avoid ↵Mark Shannon2020-12-141-0/+26
| | | | spurious line events. (GH-23761)
* Don't generate spurious line number in try-except-finally. (#23760)Mark Shannon2020-12-141-0/+17
|
* bpo-42246: Eliminate jumps to exit blocks by copying those blocks. (#23251)Mark Shannon2020-11-121-1/+1
| | | * Compiler: eliminate jumps to short exit blocks by copying.
* bpo-42246: Partial implementation of PEP 626. (GH-23113)Mark Shannon2020-11-121-4/+14
| | | * Implement new line number table format, as defined in PEP 626.
* bpo-41670: Remove outdated predict macro invocation. (GH-22026)Mark Shannon2020-09-291-0/+17
| | | Remove PREDICTion of POP_BLOCK from FOR_ITER.
* bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)Mark Shannon2020-07-301-2/+2
| | | * Move 'peephole' optimizations into compile.c and perform them directly on the CFG.
* bpo-40228: More robust frame.setlineno. (GH-19437)Mark Shannon2020-04-291-18/+17
| | | More robust frame.setlineno. Makes no assumptions about source->bytecode translation.
* bpo-39166: Fix trace of last iteration of async for loops (#17800)Pablo Galindo2020-01-101-0/+76
|
* bpo-39114: Fix tracing of except handlers with name binding (GH-17769)Pablo Galindo2020-01-021-0/+45
| | | When producing the bytecode of exception handlers with name binding (like `except Exception as e`) we need to produce a try-finally block to make sure that the name is deleted after the handler is executed to prevent cycles in the stack frame objects. The bytecode associated with this try-finally block does not have source lines associated and it was causing problems when the tracing functionality was running over it.
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↵Mark Shannon2019-11-211-1/+1
| | | | | | code for normal and exceptional paths. (#6641) Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication. Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-3/+3
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-37500: Make sure dead code does not generate bytecode but also detect ↵Pablo Galindo2019-07-151-7/+41
| | | | | | | | | | | | syntax errors (GH-14612) https://bugs.python.org/issue37500 Add a new field to the compiler structure that allows to be configured so no bytecode is emitted. In this way is possible to detect errors by walking the nodes while preserving optimizations. https://bugs.python.org/issue37500
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-0/+1
| | | | tests (GH-7328)
* bpo-30953: Improve error messages and add tests for jumping (GH-6196)Serhiy Storchaka2018-03-231-6/+64
| | | | into/out of an except block.
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-0/+55
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-33041: Add tests for jumps in/out of 'async with' blocks. (#6110)Serhiy Storchaka2018-03-181-0/+117
|
* bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6107)xdegaye2018-03-131-11/+57
| | | (cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)
* bpo-33026: Fix jumping out of "with" block by setting f_lineno. (#6026)Serhiy Storchaka2018-03-111-0/+28
|
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-17/+41
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32416: Add two new tests in test_sys_settrace. (#5072)Serhiy Storchaka2018-01-011-8/+30
| | | Move other test to more proper place.
* Fix minor spelling error in test_sys_settrace.py. (#5025)gfyoung2017-12-281-1/+1
|
* bpo-32416: Refactor tests for the f_lineno setter and add new tests. (#4991)Serhiy Storchaka2017-12-261-248/+405
|
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-081-4/+52
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* Issue #20041: Fixed TypeError when frame.f_trace is set to None.Serhiy Storchaka2016-06-041-0/+9
|\ | | | | | | Patch by Xavier de Gaye.
| * Issue #20041: Fixed TypeError when frame.f_trace is set to None.Serhiy Storchaka2016-06-041-0/+9
| | | | | | | | Patch by Xavier de Gaye.
* | Replace noop constant statement with expressionVictor Stinner2016-02-081-2/+2
|/ | | | | | | | | | * Constant statements will be ignored and the compiler will emit a SyntaxWarning. * Replace constant statement (ex: "1") with an expression statement (ex: "x=1"). * test_traceback: use context manager on the file. Issue #26204.
* pop the loop block even for infinite while loops (closes #23048)Benjamin Peterson2014-12-131-0/+11
|
* #17413: make sure settrace funcs get passed exception instances for 'value'.R David Murray2013-04-191-0/+23
| | | | Patch by Ingrid Cheung and Brendan McLoughlin.
* Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
|\ | | | | | | Patch by Serhiy Storchaka.
| * Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
| | | | | | | | Patch by Serhiy Storchaka.
* | merge 3.2 (#14612)Benjamin Peterson2012-04-181-0/+11
|\ \ | |/
| * SETUP_WITH acts like SETUP_FINALLY for the purposes of setting f_lineno ↵Benjamin Peterson2012-04-181-0/+11
| | | | | | | | (closes #14612)
* | Merge from 3.2Amaury Forgeot d'Arc2011-10-051-2/+2
|\ \ | |/
| * Enable the only tests for sys.gettraceAmaury Forgeot d'Arc2011-10-051-2/+2
| |
* | Issue #10990: Prevent tests from clobbering a set trace function.Brett Cannon2011-02-211-0/+10
|/ | | | | | | | | | | Many tests simply didn't care if they unset a pre-existing trace function. This made test coverage impossible. This patch fixes various tests to put back any pre-existing trace function. It also introduces test.support.no_tracing as a decorator which will temporarily unset the trace function for tests which simply fail otherwise. Thanks to Kristian Vlaardingerbroek for helping to find the cause of various trace function unsets.