diff options
| author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-04-07 00:37:16 +0200 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-07 18:56:50 +0200 |
| commit | 628c266c0a2b0a0498d78d8a9a01704557e46c00 (patch) | |
| tree | 701cb8b21baae8bd222d15cce41fe4b51736c293 /pylint/checkers/variables.py | |
| parent | 8f84dec53d53b8297ef753277fc1d820becd8428 (diff) | |
| download | pylint-git-628c266c0a2b0a0498d78d8a9a01704557e46c00.tar.gz | |
Fix false-positive used-before-assignment in function returns
Diffstat (limited to 'pylint/checkers/variables.py')
| -rw-r--r-- | pylint/checkers/variables.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 3ad0ab883..66bd4fdd4 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1457,7 +1457,12 @@ class VariablesChecker(BaseChecker): and defnode.lineno == node.lineno and isinstance( defstmt, - (astroid.Assign, astroid.AnnAssign, astroid.AugAssign), + ( + astroid.Assign, + astroid.AnnAssign, + astroid.AugAssign, + astroid.Return, + ), ) and isinstance(defstmt.value, astroid.JoinedStr) ) |
