Skip to content

cannot disable checks right after "else:" #9503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jwilk opened this issue Mar 13, 2024 · 1 comment
Closed

cannot disable checks right after "else:" #9503

jwilk opened this issue Mar 13, 2024 · 1 comment
Labels
Enhancement ✨ Improvement to a component High effort 🏋 Difficult solution or problem to solve Needs decision 🔒 Needs a decision before implemention or rejection

Comments

@jwilk
Copy link
Contributor

jwilk commented Mar 13, 2024

Bug description

if True:
    pass
else:
    # pylint: disable=undefined-variable
    eggs

Configuration

No response

Command used

pylint -E else.py

Pylint output

************* Module else
else.py:5:4: E0602: Undefined variable 'eggs' (undefined-variable)

Expected behavior

No errors reported.

Pylint version

pylint 3.1.0
astroid 3.1.0
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0]

OS / Environment

No response

Additional dependencies

No response

@jwilk jwilk added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 13, 2024
@jacobtylerwalls jacobtylerwalls added High effort 🏋 Difficult solution or problem to solve Needs decision 🔒 Needs a decision before implemention or rejection Enhancement ✨ Improvement to a component and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 13, 2024
@DanielNoord
Copy link
Collaborator

Duplicate of #872.

There is a fix but it never got reviewed.

@DanielNoord DanielNoord closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component High effort 🏋 Difficult solution or problem to solve Needs decision 🔒 Needs a decision before implemention or rejection
Projects
None yet
Development

No branches or pull requests

3 participants