Commit 900a7879 authored by jim's avatar jim

Added flush/fsync to the write method to try to avoid

spurious test failures.  I'm not sure this is really necessary.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@72465 62d5b8a3-27da-0310-9561-8e5933582275
parent ec447097
......@@ -26,6 +26,8 @@ import pkg_resources
import zc.buildout.buildout
import zc.buildout.easy_install
fsync = getattr(os, 'fsync', lambda fileno: None)
setuptools_location = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('setuptools')).location
......@@ -57,7 +59,12 @@ def rmdir(*path):
shutil.rmtree(os.path.join(*path))
def write(dir, *args):
open(os.path.join(dir, *(args[:-1])), 'w').write(args[-1])
path = os.path.join(dir, *(args[:-1]))
f = open(path, 'w')
f.write(args[-1])
f.flush()
fsync(f.fileno())
f.close()
def system(command, input=''):
i, o = os.popen4(command)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment