astroid
astroid copied to clipboard
Add `Try` node
Description
Depends on #1388
In the Python AST TryExcept and TryFinally have long been replaced by Try. This PR adds a new Try node to do the same in astroid.
To test this change in pylint, add this in pylinter.py (after the imports).
from astroid.manager import AstroidManager
AstroidManager.tree_rev = 2
Type of Changes
| Type | |
|---|---|
| ✓ | :sparkles: New feature |
Pull Request Test Coverage Report for Build 3403718144
- 64 of 73 (87.67%) changed or added relevant lines in 2 files are covered.
- 1 unchanged line in 1 file lost coverage.
- Overall coverage decreased (-0.04%) to 92.238%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| astroid/rebuilder.py | 14 | 18 | 77.78% |
| astroid/nodes/node_classes.py | 50 | 55 | 90.91% |
| <!-- | Total: | 64 | 73 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| astroid/rebuilder.py | 1 | 96.31% |
| <!-- | Total: | 1 |
| Totals | |
|---|---|
| Change from base Build 3393053917: | -0.04% |
| Covered Lines: | 9922 |
| Relevant Lines: | 10757 |
💛 - Coveralls
Superseded by https://github.com/PyCQA/astroid/pull/1867