Mercurial > public > mercurial-scm > hg
diff mercurial/dirstate.py @ 13400:14f3795a5ed7
explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Fri, 24 Dec 2010 15:23:01 +0100 |
parents | 69e69b131458 |
children | a464763e99f1 bc41d08a5ccc |
line wrap: on
line diff
--- a/mercurial/dirstate.py Fri Feb 11 22:24:10 2011 +0800 +++ b/mercurial/dirstate.py Fri Dec 24 15:23:01 2010 +0100 @@ -80,7 +80,9 @@ @propertycache def _pl(self): try: - st = self._opener("dirstate").read(40) + fp = self._opener("dirstate") + st = fp.read(40) + fp.close() l = len(st) if l == 40: return st[:20], st[20:40]