Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Checkins

r66259 - doctools/trunk/setup.py

 

 

Python checkins RSS feed   Index | Next | Previous | View Threaded


python-checkins at python

Sep 6, 2008, 10:39 AM

Post #1 of 1 (31 views)
Permalink
r66259 - doctools/trunk/setup.py

Author: georg.brandl
Date: Sat Sep 6 19:39:32 2008
New Revision: 66259

Log:
Fix warning when json is not available.


Modified:
doctools/trunk/setup.py

Modified: doctools/trunk/setup.py
==============================================================================
--- doctools/trunk/setup.py (original)
+++ doctools/trunk/setup.py Sat Sep 6 19:39:32 2008
@@ -5,6 +5,7 @@
import os
import sys
from setuptools import setup
+from distutils import log

import sphinx

@@ -63,14 +64,16 @@
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):
"""
_______________________________________________
Python-checkins mailing list
Python-checkins[at]python.org
http://mail.python.org/mailman/listinfo/python-checkins

Python checkins RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.