| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…r and no fallthrough
|
Two questions.
|
Sorry, something went wrong.
It does. The issue is not the nesting, but the multiple paths leading to the end of the except block. It needs to be nested in another except because otherwise the blocks get reordered and this impacts the situation. But with nesting all the blocks are cold, so they remain in this order. More nesting doesn't make a difference.
I'll try to add a unit test. This PR makes the build pass with the assertion that all eval break checks have line numbers (there are 3 more test failures then, but at least we get through the build). |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good
Sorry, something went wrong.
…r and no fallthrough (python#114750)
…r and no fallthrough (python#114750)
| Back | FazBrowse Home | New Git URL |
This pattern shows up in code like this:
def f(): for e in seq: try: X = 3 except OSError: try: if C3: X = 4 except OSError: pass return 42We have a block with no line number, and two predecessors, which contains a jump to another block that has no line number. The two-predecessor block is not an exit block so it is not duplicated. As a result, the end block remains with no line number, even if it needs one. This change inlines the first block to each of its predecessors, so that the jump can get a line number.