-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed as not planned
Labels
Bug 🪲False Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the codeHigh effort 🏋Difficult solution or problem to solveDifficult solution or problem to solveNeeds astroid Brain 🧠Needs a brain tip in astroid (then an astroid upgrade)Needs a brain tip in astroid (then an astroid upgrade)python 3.7
Description
Bug description
import asyncio
async def coro():
try:
await asyncio.sleep(0.5)
except asyncio.CancelledError:
raise
except ValueError:
pass
No warning raised when running in a python 3.7 venv, W0706(try-except-raise)
warning raised with an identical pylint call when running in a 3.9 venv.
# pylint: disable=try-except-raise,useless-suppression
thus needed to make pylint happy on both 3.7 and 3.9.
Configuration
No response
Command used
pylint demo.py
Pylint output
************* Module bluelink.demo
demo.py:7: [W0706(try-except-raise), coro] The except handler raises immediately
Expected behavior
No warning raised, as on 3.7. It's a false positive.
Pylint version
pylint 2.12.2
astroid 2.9.3
Python 3.7.12 (default, Mar 8 2022, 11:09:12)
[GCC 11.2.1 20220115]
and
pylint 2.12.2
astroid 2.9.3
Python 3.9.10 (main, Mar 8 2022, 11:00:59)
[GCC 11.2.1 20220115]
OS / Environment
~amd64 Gentoo (outputs above) and Debian Buster (with different python patch-level versions)
Additional dependencies
No response
Metadata
Metadata
Assignees
Labels
Bug 🪲False Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the codeHigh effort 🏋Difficult solution or problem to solveDifficult solution or problem to solveNeeds astroid Brain 🧠Needs a brain tip in astroid (then an astroid upgrade)Needs a brain tip in astroid (then an astroid upgrade)python 3.7