Revision: 8676 Author: xqt Date: 2010-10-21 07:42:44 +0000 (Thu, 21 Oct 2010)
Log Message: ----------- enable script for pre py2.6
Modified Paths: -------------- trunk/pywikipedia/panoramiopicker.py
Modified: trunk/pywikipedia/panoramiopicker.py =================================================================== --- trunk/pywikipedia/panoramiopicker.py 2010-10-20 22:03:52 UTC (rev 8675) +++ trunk/pywikipedia/panoramiopicker.py 2010-10-21 07:42:44 UTC (rev 8676) @@ -11,7 +11,16 @@ # __version__ = '$Id$'
-import sys, urllib, re, StringIO, hashlib, base64, time, json +import sys, urllib, re, StringIO, hashlib, base64, time +try: + #For Python 2.6 newer + import json + if not hasattr(json, 'loads'): + # 'json' can also be the name in for + # http://pypi.python.org/pypi/python-json + raise ImportError +except ImportError: + import simplejson as json import wikipedia as pywikibot import config, query, imagerecat, upload
pywikipedia-svn@lists.wikimedia.org