From d457485d1badd2502b90f196541447feb5da58dc Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 14 Feb 2007 01:07:45 +0100 Subject: [PATCH] [svn r38772] Make sure target dir exists before writing files to it. --HG-- branch : trunk --- py/apigen/apigen.py | 3 ++- py/doc/confrest.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/py/apigen/apigen.py b/py/apigen/apigen.py index 69777b8e0..af421e88d 100644 --- a/py/apigen/apigen.py +++ b/py/apigen/apigen.py @@ -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) diff --git a/py/doc/confrest.py b/py/doc/confrest.py index 900a674db..b3d29ad4e 100644 --- a/py/doc/confrest.py +++ b/py/doc/confrest.py @@ -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)