Mercurial > public > mercurial-scm > hg
diff tests/test-symlink-os-yes-fs-no.py @ 14168:135e244776f0
prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.
This implies:
- changing opener(...).read() calls to opener.read(...)
- changing opener(...).write() calls to opener.write(...)
- changing open(...).read(...) to util.readfile(...)
- changing open(...).write(...) to util.writefile(...)
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Mon, 02 May 2011 10:11:18 +0200 |
parents | cd3032437064 |
children | d976542986d2 |
line wrap: on
line diff
--- a/tests/test-symlink-os-yes-fs-no.py Mon May 02 10:11:05 2011 +0200 +++ b/tests/test-symlink-os-yes-fs-no.py Mon May 02 10:11:18 2011 +0200 @@ -1,5 +1,5 @@ import os, sys, time -from mercurial import hg, ui, commands +from mercurial import hg, ui, commands, util TESTDIR = os.environ["TESTDIR"] BUNDLEPATH = os.path.join(TESTDIR, 'bundles', 'test-no-symlinks.hg') @@ -29,7 +29,7 @@ for f in 'test0/a.lnk', 'test0/d/b.lnk': os.unlink(f) fp = open(f, 'wb') - fp.write(open(f[:-4]).read()) + fp.write(util.readfile(f[:-4])) fp.close() # reload repository