astroid icon indicating copy to clipboard operation
astroid copied to clipboard

Add `Try` node

Open cdce8p opened this issue 4 years ago • 1 comments

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

cdce8p avatar Feb 10 '22 19:02 cdce8p

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 Coverage Status
Change from base Build 3393053917: -0.04%
Covered Lines: 9922
Relevant Lines: 10757

💛 - Coveralls

coveralls avatar May 13 '22 13:05 coveralls

Superseded by https://github.com/PyCQA/astroid/pull/1867

cdce8p avatar Nov 14 '22 11:11 cdce8p