[svn r38772] Make sure target dir exists before writing files to it.

--HG--
branch : trunk
This commit is contained in:
guido 2007-02-14 01:07:45 +01:00
parent 13c44faa38
commit d457485d1b
2 changed files with 4 additions and 1 deletions

View File

@ -41,7 +41,8 @@ def build(pkgdir, dsa, capture):
# output dir
from py.__.conftest import option
targetdir = get_apigenpath()
targetdir.ensure(dir=True)
if not targetdir.check(dir=True):
targetdir.ensure(dir=True)
# find out what to build
all_names = dsa._get_names(filter=lambda x, y: True)

View File

@ -135,6 +135,8 @@ class Project:
stylesheet = self.stylesheet
if isinstance(self.stylesheet, py.path.local):
if not docpath.join(stylesheet.basename).check():
if not docpath.check(dir=True):
docpath.ensure(dir=True)
stylesheet.copy(docpath)
stylesheet = relpath(outputpath.strpath,
docpath.join(stylesheet.basename).strpath)