# HG changeset patch # User Matt Harbison # Date 2018-12-15 19:55:06 # Node ID 120ecb17242b4edd5a14d6abb094df7d97d78835 # Parent 8d9f366b7f199c690c048f0c77a65cff4fc9bf47 windows: ensure pure posixfile fd doesn't escape by entering context manager There are tests in test-revlog-mmapindex.t and test-rebase-mq-skip.t that are fixed by this, but we usually don't use --pure on Windows. For whatever reason, the remaining --pure failures are various errors like $ENOTDIR$ and "Access is denied" have a trailing '.'. 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)