Mercurial > evolve
changeset 2316:35a548465647 stable
compat: drop the context manager used to write the cache file
Mercurial 3.8 does not supports context manager on atomic temporary file.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 03 May 2017 13:27:26 +0200 |
parents | e16f6bef5848 |
children | 7263463ae79a 8ba42b1576d0 |
files | hgext3rd/evolve/obscache.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/obscache.py Wed May 03 12:54:11 2017 +0200 +++ b/hgext3rd/evolve/obscache.py Wed May 03 13:27:26 2017 +0200 @@ -307,10 +307,11 @@ if self._cachekey is None or self._cachekey == self._ondiskkey: return - with repo.vfs(self._filepath, 'w', atomictemp=True) as cachefile: - headerdata = struct.pack(self._headerformat, *self._cachekey) - cachefile.write(headerdata) - cachefile.write(self._data) + cachefile = repo.vfs(self._filepath, 'w', atomictemp=True) + headerdata = struct.pack(self._headerformat, *self._cachekey) + cachefile.write(headerdata) + cachefile.write(self._data) + cachefile.close() def load(self, repo): """load data from disk"""