mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Make docutils requirement explicit. Fixes #1243.
Previously, the error returned by Python when docutils is not installed was not explicit, instead saying that HTMLTranslator is not defined (needed by FeedGenerator and such), forcing the user to go into readers.py to figure out that this happens because "import docutils" failed. This pull request makes the docutils dependency explicit, so that there is an ImportError if doctutils is not found.
This commit is contained in:
parent
f0802e8114
commit
260953da02
1 changed files with 6 additions and 9 deletions
|
|
@ -6,16 +6,13 @@ import logging
|
|||
import os
|
||||
import re
|
||||
|
||||
try:
|
||||
import docutils
|
||||
import docutils.core
|
||||
import docutils.io
|
||||
from docutils.writers.html4css1 import HTMLTranslator
|
||||
import docutils
|
||||
import docutils.core
|
||||
import docutils.io
|
||||
from docutils.writers.html4css1 import HTMLTranslator
|
||||
|
||||
# import the directives to have pygments support
|
||||
from pelican import rstdirectives # NOQA
|
||||
except ImportError:
|
||||
docutils = False
|
||||
# import the directives to have pygments support
|
||||
from pelican import rstdirectives # NOQA
|
||||
try:
|
||||
from markdown import Markdown
|
||||
except ImportError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue