# HG changeset patch # User Jeff Hammel # Date 1312333435 25200 # Node ID d6528dd745925688a487bd8b01f3f170e5d46d1a # Parent d9026d1146550bb167fea8d5c0b3237164a1eb8b only create the directory if we need to diff -r d9026d114655 -r d6528dd74592 document_it.py --- a/document_it.py Tue Aug 02 16:46:40 2011 -0700 +++ b/document_it.py Tue Aug 02 18:03:55 2011 -0700 @@ -148,7 +148,10 @@ # create a directory if needed dirname = os.path.dirname(dest) - os.makedirs(dirname) + if os.path.exists(dirname): + assert os.path.isdir(dirname) + else: + os.makedirs(dirname) # render f = file(dest, 'w')