Mercurial > public > mercurial-scm > hg
comparison mercurial/windows.py @ 40938:9ae4aed27930 stable
windows: ensure mixedfilemodewrapper fd doesn't escape by entering context mgr
Otherwise it seems that the special read and write handling would be bypassed.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 15 Dec 2018 13:41:34 -0500 |
parents | e11e03f72baf |
children | 593f6359681d |
comparison
equal
deleted
inserted
replaced
40937:e11e03f72baf | 40938:9ae4aed27930 |
---|---|
68 def __init__(self, fp): | 68 def __init__(self, fp): |
69 object.__setattr__(self, r'_fp', fp) | 69 object.__setattr__(self, r'_fp', fp) |
70 object.__setattr__(self, r'_lastop', 0) | 70 object.__setattr__(self, r'_lastop', 0) |
71 | 71 |
72 def __enter__(self): | 72 def __enter__(self): |
73 return self._fp.__enter__() | 73 self._fp.__enter__() |
74 return self | |
74 | 75 |
75 def __exit__(self, exc_type, exc_val, exc_tb): | 76 def __exit__(self, exc_type, exc_val, exc_tb): |
76 self._fp.__exit__(exc_type, exc_val, exc_tb) | 77 self._fp.__exit__(exc_type, exc_val, exc_tb) |
77 | 78 |
78 def __getattr__(self, name): | 79 def __getattr__(self, name): |