Mercurial > public > mercurial-scm > hg
diff mercurial/util.py @ 13098:f7d6750dcd01
util: make atomicfiles closable
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Tue, 07 Dec 2010 16:03:42 +0100 |
parents | 8c6b7a5f38c4 |
children | a08b49d2f116 |
line wrap: on
line diff
--- a/mercurial/util.py Mon Dec 06 21:17:27 2010 -0500 +++ b/mercurial/util.py Tue Dec 07 16:03:42 2010 +0100 @@ -822,7 +822,7 @@ self._fp.close() rename(self.temp, localpath(self.__name)) - def __del__(self): + def close(self): if not self._fp: return if not self._fp.closed: @@ -831,6 +831,9 @@ except: pass self._fp.close() + def __del__(self): + self.close() + def makedirs(name, mode=None): """recursive directory creation with parent mode inheritance""" parent = os.path.abspath(os.path.dirname(name))