[py-svn] r38772 - in py/trunk/py: apigen doc

guido at codespeak.net guido at codespeak.net
Wed Feb 14 01:07:47 CET 2007


Author: guido
Date: Wed Feb 14 01:07:45 2007
New Revision: 38772

Modified:
   py/trunk/py/apigen/apigen.py
   py/trunk/py/doc/confrest.py
Log:
Make sure target dir exists before writing files to it.


Modified: py/trunk/py/apigen/apigen.py
==============================================================================
--- py/trunk/py/apigen/apigen.py	(original)
+++ py/trunk/py/apigen/apigen.py	Wed Feb 14 01:07:45 2007
@@ -41,7 +41,8 @@
     # 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)

Modified: py/trunk/py/doc/confrest.py
==============================================================================
--- py/trunk/py/doc/confrest.py	(original)
+++ py/trunk/py/doc/confrest.py	Wed Feb 14 01:07:45 2007
@@ -135,6 +135,8 @@
         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)



More information about the pytest-commit mailing list