fix(utils): use stacklevel=3

level on which descriptor is being called
This commit is contained in:
mpa 2020-09-05 09:57:03 +04:00
parent 70aa5fd0fb
commit bcbbdc3830
No known key found for this signature in database
GPG key ID: BCCFBFCCC9B754A8

View file

@ -160,5 +160,5 @@ class DeprecatedReadOnlyClassVar(Generic[_OwnerCls, _VT]):
self._new_value_getter = new_value_getter
def __get__(self, instance: Optional[_OwnerCls], owner: Type[_OwnerCls]):
warn_deprecated(self._warning_message)
warn_deprecated(self._warning_message, stacklevel=3)
return self._new_value_getter(owner)