Commits

Anonymous committed a40621f

Fix warning when json is not available.

  • Participants
  • Parent commits 6bb3e0f

Comments (0)

Files changed (1)

 import os
 import sys
 from setuptools import setup
+from distutils import log
 
 import sphinx
 
 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):
         """