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

(cherry picked from commit 0dac68f1e5)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2019-08-29 02:02:51 -07:00 committed by Raymond Hettinger
parent 0d45d50e42
commit c71ae1a45b
5 changed files with 24 additions and 13 deletions

View file

@ -2806,7 +2806,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)