You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by ni...@apache.org on 2014/01/21 00:03:54 UTC

svn commit: r1559849 - /comdev/nearby_people/lib/geoname.py

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