1
0
Fork 0
forked from github/pelican

Merge pull request #159 from myano/master

checks if pdf_path exists before trying to create pdf_path
This commit is contained in:
Alexis Metaireau 2011-08-20 07:43:11 -07:00
commit 28e13be3a4

View file

@ -392,11 +392,12 @@ class PdfGenerator(Generator):
# since we write our own files
info(u' Generating PDF files...')
pdf_path = os.path.join(self.output_path, 'pdf')
try:
os.mkdir(pdf_path)
except OSError:
error("Couldn't create the pdf output folder in " + pdf_path)
pass
if not os.path.exists(pdf_path):
try:
os.mkdir(pdf_path)
except OSError:
error("Couldn't create the pdf output folder in " + pdf_path)
pass
for article in self.context['articles']:
self._create_pdf(article, pdf_path)