Skip to content
Browse files

Merge pull request #159 from myano/master

checks if pdf_path exists before trying to create pdf_path
  • Loading branch information...
2 parents 100d94c + 5b4e148 commit 28e13be3a4761b65d9ebd53518ab9e364d8cc36c Alexis Metaireau committed Aug 20, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 pelican/generators.py
View
11 pelican/generators.py
@@ -392,11 +392,12 @@ def generate_output(self, writer=None):
# 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)

0 comments on commit 28e13be

Please sign in to comment.
Something went wrong with that request. Please try again.