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:
commit
28e13be3a4
1 changed files with 6 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue