Skip to content

AttributeError: 'Call' object has no attribute 'value' #171

@jaap3

Description

@jaap3

I added flake8-bugbear to a project that could use some cleanup, but upon running flake8 it crashed with a AttributeError: 'Call' object has no attribute 'value'.

I boiled down the offending code to this reproducer:

from django.contrib.auth import get_user_model


def get_user_by_email(email):
    try:
        return get_user_model().get(email=email)
    except (
        get_user_model().DoesNotExist,
        get_user_model().MultipleObjectsReturned
    ):
        pass

This is with the following version of flake8/plugins/python:

flake8 --version
3.9.2 (flake8-bugbear: 21.4.3, mccabe: 0.6.1, pycodestyle: 2.7.0, pyflakes:
2.3.1) CPython 3.7.10 on Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions