Skip to content

AttributeError: 'function' object has no attribute 'validate_response' #246

@renew010101

Description

@renew010101

Environment:
As follow up for MR #225 , please make the code more defensive:

AttributeError: 'function' object has no attribute 'validate_response'

is caused by

if func.validate_response is not None:
    _validate_response = func.validate_response
else:
    _validate_response = self.validate_response

please change to:

_validate_response = getattr(func, "validate_response", None) or getattr(self, "validate_response", None)

to make more defensive. This gives issues when upgrading from 4.2.x to 4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions