Skip to content

Module 'google.protobuf.any_pb2' has no 'Any' member Β #6281

Open

Description

Bug description

When running pylint on the following code:

from google.protobuf import any_pb2

isinstance("foo", any_pb2.Any)

Throws a linter warning since protobuf==3.20.0 (It still worked fine with 3.19.4)

Executing the code directly in python yields no error:

from google.protobuf import any_pb2
isinstance("foo", any_pb2.Any)
isinstance(any_pb2.Any(), any_pb2.Any)

Configuration

No response

Command used

pylint test.py

Pylint output

************* Module test
test.py:5:18: E1101: Module 'google.protobuf.any_pb2' has no 'Any' member (no-member)

Expected behavior

No warning.

Pylint version

pylint 2.12.1
astroid 2.9.0
Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
[GCC 9.4.0]

OS / Environment

Ubuntu 20.04

Additional dependencies

protobuf==3.19.4
protobuf==3.20.0

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

Metadata

Assignees

No one assigned

    Labels

    Help wanted πŸ™Outside help would be appreciated, good for new contributorsLib specific πŸ’…This affect the code from a particular libraryNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationNeeds astroid Brain 🧠Needs a brain tip in astroid (then an astroid upgrade)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions