summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorgeorg.brandl <devnull@localhost>2008-09-06 17:39:32 +0000
committergeorg.brandl <devnull@localhost>2008-09-06 17:39:32 +0000
commit52a3b148a8a1bd829d77d8f7bc81f10a2ac4fabc (patch)
tree1f6b6d1973f7bade74da7fef53059907a87d16d7 /setup.py
parente1f6a59d933a08be9cff31d714832c7dd79a500d (diff)
downloadsphinx-52a3b148a8a1bd829d77d8f7bc81f10a2ac4fabc.tar.gz
Fix warning when json is not available.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 753079ba..636ec3a9 100644
--- a/setup.py
+++ b/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):
"""