bpo-36743: __get__ is sometimes called without the owner argument (#12992)

This commit is contained in:
Raymond Hettinger 2019-08-29 01:27:42 -07:00 committed by GitHub
parent 84125fed2a
commit 0dac68f1e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 13 deletions

View file

@ -2804,7 +2804,7 @@ class PropertyMock(Mock):
def _get_child_mock(self, /, **kwargs):
return MagicMock(**kwargs)
def __get__(self, obj, obj_type):
def __get__(self, obj, obj_type=None):
return self()
def __set__(self, obj, val):
self(val)