Commit af8646c
authored
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (pythonGH-13332)
Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.1 parent a8b4694 commit af8646c
4 files changed
Lines changed: 33 additions & 9 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Core and Builtins
- Python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
699 | 713 | | |
700 | 714 | | |
701 | 715 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2546 | 2546 | | |
2547 | 2547 | | |
2548 | 2548 | | |
2549 | | - | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
2550 | 2552 | | |
2551 | 2553 | | |
2552 | | - | |
2553 | | - | |
2554 | | - | |
2555 | | - | |
| 2554 | + | |
2556 | 2555 | | |
2557 | 2556 | | |
2558 | 2557 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
| 305 | + | |
307 | 306 | | |
308 | | - | |
309 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
| |||
0 commit comments