2009/9/21 Milos Rancic <mill...@gmail.com>:
> I've found one more thing...
>
> Inside of query.py there are lines for loading json or simplejson:
>
> try:
>    #For Python 2.6 newer
>    import json
> except ImportError:
>    import simplejson as json
>
> I am not using 2.6, but 2.5.4, but I have module json.

What module is this? A json module, under 2.5? Where did you get it?

>
> However, there are two json.loads commands:
>
>            # This will also work, but all unicode strings will need
> to be converted from \u notation
>            # decodedObj = eval( jsontext )
>            if back_response:
>                return res, json.loads( jsontext )
>            else:
>                return json.loads( jsontext )
>
> ... and simplejson has it, but json doesn't. So, I've fixed my
> pywikipediabot by commenting try-except at the beginning and leaving
> just "import simplejson as json".

import json is meant for 2.6. In 2.6, json _has_ the loads method:
http://docs.python.org/library/json.html#json.loads


-- 
Nicolas Dumazet — NicDumZ

_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to