Skip to content

False negative for deprecated-module when a __import__ method is used instead of import sentence. #10453

@moylop260

Description

@moylop260

Bug description

# pylint: disable=invalid-name

__import__("mypackage")

Configuration

[Imports]
deprecated-modules=mypackage

Command used

pylint -d all -e deprecated-module

Pylint output

# Empty output

Expected behavior

Deprecated module 'mypackage' (deprecated-module)

This style is used from popular auto-code snippets:

Pylint version

pylint 4.0.0-dev0
astroid 4.0.0a0
Python 3.12.11 (main, Jun  3 2025, 15:41:47) [Clang 17.0.0 (clang-1700.0.13.3)]

OS / Environment

MACOSX

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions