community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1559849 - /comdev/nearby_people/lib/geoname.py
Date Mon, 20 Jan 2014 23:03:54 GMT
Author: nick
Date: Mon Jan 20 23:03:53 2014
New Revision: 1559849

URL: http://svn.apache.org/r1559849
Log:
More old json library fixes

Modified:
    comdev/nearby_people/lib/geoname.py

Modified: comdev/nearby_people/lib/geoname.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/lib/geoname.py?rev=1559849&r1=1559848&r2=1559849&view=diff
==============================================================================
--- comdev/nearby_people/lib/geoname.py (original)
+++ comdev/nearby_people/lib/geoname.py Mon Jan 20 23:03:53 2014
@@ -6,9 +6,9 @@ import sys
 import urllib
 import urllib2
 try:
-    import simplejson as json
+    from simplejson import loads as json_parse
 except ImportError:
-    import json
+    from json import read as json_parse
 
 DOMAIN = 'http://api.geonames.org/'
 USERNAME = '' #enter your geonames username here
@@ -30,7 +30,7 @@ def fetchJson(method, dparams):
     if DEBUG:
         print uri
     resource = urllib2.urlopen(uri).readlines()
-    js = json.loads(resource[0])
+    js = json_parse(resource[0])
     if DEBUG:
         print js
     return js



Mime
View raw message