Skip to content

False positive of unused-import since v2.15.0 #7506

Description

Bug description

Given the following code:

# pylint: disable=missing-docstring,too-few-public-methods

import abc
import six


class MyClass(six.with_metaclass(abc.ABCMeta)):
    pass

Configuration

No response

Command used

pylint a.py

Pylint output

************* Module t
t.py:4:0: W0611: Unused import six (unused-import)

------------------------------------------------------------------
Your code has been rated at 7.50/10 (previous run: 2.50/10, +5.00)

Expected behavior

No unused-import should be raised

Pylint version

pylint 2.15.0
astroid 2.12.10
Python 3.9.13 (main, Jun  1 2022, 14:19:10)
[GCC 11.2.0]

This cannot be reproduced in v2.14.5.



### OS / Environment

_No response_

### Additional dependencies

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableRegression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions