diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py --- a/mercurial/pure/osutil.py +++ b/mercurial/pure/osutil.py @@ -267,7 +267,8 @@ else: return self._file.__setattr__(name, value) def __enter__(self): - return self._file.__enter__() + self._file.__enter__() + return self def __exit__(self, exc_type, exc_value, exc_tb): return self._file.__exit__(exc_type, exc_value, exc_tb)