mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added better error message for missing roman.py
This commit is contained in:
parent
733b2b5bc6
commit
c788e0467c
@ -31,17 +31,23 @@ def main(argv=sys.argv):
|
|||||||
errstr = str(err)
|
errstr = str(err)
|
||||||
if errstr.lower().startswith('no module named'):
|
if errstr.lower().startswith('no module named'):
|
||||||
whichmod = errstr[16:]
|
whichmod = errstr[16:]
|
||||||
|
hint = ''
|
||||||
if whichmod.startswith('docutils'):
|
if whichmod.startswith('docutils'):
|
||||||
whichmod = 'Docutils library'
|
whichmod = 'Docutils library'
|
||||||
elif whichmod.startswith('jinja'):
|
elif whichmod.startswith('jinja'):
|
||||||
whichmod = 'Jinja library'
|
whichmod = 'Jinja library'
|
||||||
elif whichmod == 'roman':
|
elif whichmod == 'roman':
|
||||||
whichmod = 'roman module (which is distributed with Docutils)'
|
whichmod = 'roman module (which is distributed with Docutils)'
|
||||||
|
hint = ('This can happen if you upgraded docutils using\n'
|
||||||
|
'easy_install without uninstalling the old version'
|
||||||
|
'first.')
|
||||||
else:
|
else:
|
||||||
whichmod += ' module'
|
whichmod += ' module'
|
||||||
print >>sys.stderr, \
|
print >>sys.stderr, \
|
||||||
'Error: The %s cannot be found. Did you install Sphinx '\
|
'Error: The %s cannot be found. Did you install Sphinx '\
|
||||||
'and its dependencies correctly?' % whichmod
|
'and its dependencies correctly?' % whichmod
|
||||||
|
if hint:
|
||||||
|
print >> sys.stderr, hint
|
||||||
return 1
|
return 1
|
||||||
raise
|
raise
|
||||||
return cmdline.main(argv)
|
return cmdline.main(argv)
|
||||||
|
Loading…
Reference in New Issue
Block a user