Fix directory creation
authorBernie Innocenti <bernie@codewiz.org>
Mon, 27 Jul 2009 15:43:11 +0000 (17:43 +0200)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 27 Jul 2009 15:43:11 +0000 (17:43 +0200)
geekigeeki.py

index d3ce2203bdb6ef379d4fdcec2ebf6e83494e5a0c..2fb90303413158f3dcd21236f1d3f47fad84018d 100755 (executable)
@@ -795,7 +795,9 @@ class Page:
                 os.remove(name)
             except OSError, err:
                 if err.errno != errno.ENOENT: raise err
-        os.makedirs(os.path.split(name)[0])
+        path = os.path.split(name)[0]
+        if not os.path.exists(path):
+            os.makedirs(path)
         os.rename(tmp_filename, name)
 
     def save(self, newdata, changelog):