# HG changeset patch # User Matt Harbison # Date 2018-12-15 18:41:34 # Node ID 9ae4aed27930c5d16a57920391ef3982f2222212 # Parent e11e03f72baf832f4994447ee2120ac67bd0fb08 windows: ensure mixedfilemodewrapper fd doesn't escape by entering context mgr Otherwise it seems that the special read and write handling would be bypassed. diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -70,7 +70,8 @@ class mixedfilemodewrapper(object): object.__setattr__(self, r'_lastop', 0) def __enter__(self): - return self._fp.__enter__() + self._fp.__enter__() + return self def __exit__(self, exc_type, exc_val, exc_tb): self._fp.__exit__(exc_type, exc_val, exc_tb)