forked from github/pelican
Updated pelican/generators.py to check if the folder exists before
trying to create it. It will always generate an OSError if the folder already exists even if it has the appropriate permissions.
This commit is contained in:
parent
100d94cd12
commit
5b4e148a2e
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