Skip to content

Commit a07d3b5

Browse files
Red4Rupicnixz
andauthored
Avoid re-call of self.getter
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent e28c3fb commit a07d3b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/unittest/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ def __enter__(self):
16481648
exit_stack=exit_stack,
16491649
is_local=is_local,
16501650
original=original,
1651-
target=self.getter(),
1651+
target=target,
16521652
)
16531653
try:
16541654
setattr(self.target, self.attribute, new_attr)

0 commit comments

Comments
 (0)