You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
************* Module test
test.py:5:15: E1101: Instance of 'TypeError' has no 'exceptions' member (no-member)
The cause of this is that:
Current behavior
ExceptHandler infers the type of eg to be TypeError.
Expected behavior
ExceptHandler infers the type of eg to be (something along the lines of): ExceptionGroup[UnionException[TypeError]] where UnionException[T] = Union[ExceptionGroup[UnionException[T]], T]
In English: The named variable in the except* handler is of type ExceptionGroup, and this group contains one or more members that match the except* clause, possibly nested in further ExceptionGroups.
Steps to reproduce
I'm reproducing this using pylint, as that's how I encountered the issue, and I found that the issue originates in astroid.
python test.py
:pylint -E test.py
:The cause of this is that:
Current behavior
ExceptHandler infers the type of
eg
to beTypeError
.Expected behavior
ExceptHandler infers the type of
eg
to be (something along the lines of):ExceptionGroup[UnionException[TypeError]]
whereUnionException[T] = Union[ExceptionGroup[UnionException[T]], T]
In English: The named variable in the
except*
handler is of typeExceptionGroup
, and this group contains one or more members that match theexcept*
clause, possibly nested in furtherExceptionGroup
s.python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output3.1.0
The text was updated successfully, but these errors were encountered: