-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Closed
Copy link
Labels
BackportedC: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code
Milestone
Description
Bug description
if input():
import os.path
else:
os = None
if os:
pass
Command used
$ pylint -E condimport.py
Pylint output
condimport.py:5:3: E0606: Possibly using variable 'os' before assignment (possibly-used-before-assignment)
Expected behavior
The os
variable is set in both branches, so no error should be reported.
Pylint version
pylint 3.3.1
astroid 3.3.5
Python 3.13.0 (main, Oct 8 2024, 08:51:27) [GCC 9.4.0]
Metadata
Metadata
Assignees
Labels
BackportedC: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the code