mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix warning when json is not available.
This commit is contained in:
parent
7a66b9d2a2
commit
679cdb3348
11
setup.py
11
setup.py
@ -5,6 +5,7 @@ ez_setup.use_setuptools()
|
||||
import os
|
||||
import sys
|
||||
from setuptools import setup
|
||||
from distutils import log
|
||||
|
||||
import sphinx
|
||||
|
||||
@ -63,14 +64,16 @@ cmdclass = {}
|
||||
try:
|
||||
from babel.messages.pofile import read_po
|
||||
from babel.messages.frontend import compile_catalog
|
||||
from simplejson import dump
|
||||
from distutils import log
|
||||
try:
|
||||
from simplejson import dump
|
||||
except ImportError:
|
||||
from json import dump
|
||||
except ImportError:
|
||||
class compile_catalog_plusjs(compile_catalog):
|
||||
def run(self):
|
||||
compile_catalog.run(self)
|
||||
log.warning('simplejson or babel is not available; not writing '
|
||||
'JavaScript translation files.')
|
||||
log.warn('simplejson/json or babel is not available; not writing '
|
||||
'JavaScript translation files.')
|
||||
else:
|
||||
class compile_catalog_plusjs(compile_catalog):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user