changeset 40469:120ecb17242b stable

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 '.'.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 15 Dec 2018 14:55:06 -0500
parents 8d9f366b7f19
children 328557af18eb
files mercurial/pure/osutil.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pure/osutil.py	Sat Dec 15 13:54:37 2018 -0500
+++ b/mercurial/pure/osutil.py	Sat Dec 15 14:55:06 2018 -0500
@@ -267,7 +267,8 @@
             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)