Commits

Dejan Noveski committed e534a46

json/simplejson bug resolved

  • Participants
  • Parent commits b3f52e5

Comments (0)

Files changed (1)

plugin/w3cvalidate.vim

 
 function! s:W3cValidate(...)
 python << EOF
-import vim, urllib2, urllib, simplejson, re
+import vim, urllib2, urllib, re
+try:
+    import simplejson as json
+except ImportError:
+    import json
 
 OUTPUT = 'json'
 VERBOSE = 0
 
 try:
     response = urllib2.urlopen(URL, post_dat, TIMEOUT).read()
-    json_response = simplejson.loads(response)
+    json_response = json.loads(response)
     messages = json_response.get("messages", [])
     
     vim.command("call s:W3ScratchBufferOpen()")