Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

False positive: undefined variable #1420

@gtalarico

Description

@gtalarico

vscode: .136.1
python 3.7.3
darwin 10.14.5

Repro

def py_repro():
    for n in range(10):
        print(n)
    else:
        error_code = 10
        raise NotImplementedError(f"some error: {error_code}")
        # Undefined variable: 'error_code'Python(undefined-variable)

image

// settings.json
{
    "python.pythonPath": ".venv/bin/python",
    "python.formatting.provider": "black",
    "editor.rulers": [
        90
    ],
    "editor.formatOnSave": true,
    "python.linting.mypyEnabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    // Allowed Usage of Stubs for AC ?
    "python.jediEnabled": false,
    "python.analysis.disabled": [
        "inherit-non-class"
    ],
}

PS: looked for duplicate, apologies if I missed it

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions