diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-27 06:09:20 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-27 06:09:20 -0500 |
commit | 99ba12c0121eaeedca3f42be52c87f23605c6771 (patch) | |
tree | 56d73b702b7124665e06dc1d87be57573f9c794d /coverage/parser.py | |
parent | c0bc340c178b971e23f5a764b7923c1393c9cf6f (diff) | |
download | python-coveragepy-git-99ba12c0121eaeedca3f42be52c87f23605c6771.tar.gz |
Simplify a condition
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index 2d0bceba..1a2ff5f8 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -653,12 +653,11 @@ class AstArcAnalyzer(object): try_block.raise_from | # or a `raise`, try_block.return_from # or a `return`. ) - if node.handlers: - if last_handler_start is not None: - # If we had handlers, and we didn't have a bare `except:` - # handler, then the last handler jumps to the `finally` for the - # unhandled exceptions. - final_from.add(last_handler_start) + if last_handler_start is not None: + # If we had handlers, and we didn't have a bare `except:` + # handler, then the last handler jumps to the `finally` for the + # unhandled exceptions. + final_from.add(last_handler_start) exits = self.add_body_arcs(node.finalbody, prev_lines=final_from) if try_block.break_from: |