summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-05-19 15:10:39 -0400
committerGuillaume Seguin <guillaume@segu.in>2010-05-19 15:10:39 -0400
commit8bc716675983985d46fe4e914e494e967d35ce36 (patch)
tree23bfa068d635c3440af76c8515b701e47d4a08f3
parent3b530af71f5db0e07241ba2966880b9cb64f50c1 (diff)
downloadsqwareapi-8bc716675983985d46fe4e914e494e967d35ce36.tar.gz
sqwareapi-8bc716675983985d46fe4e914e494e967d35ce36.tar.bz2
Support py2.6 without simplejson
-rw-r--r--sqwarea/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sqwarea/__init__.py b/sqwarea/__init__.py
index 6234d82..0f99dcb 100644
--- a/sqwarea/__init__.py
+++ b/sqwarea/__init__.py
@@ -2,13 +2,17 @@ import httplib, urllib, urllib2, urlparse
import cookielib
httplib.HTTPConnection.debuglevel = 1
import os
+import sys
import hashlib
import logging
import time, datetime
import math
try:
- import simplejson
+ if sys.version_info >= (2, 6):
+ import json as simplejson
+ else:
+ import simplejson
from BeautifulSoup import BeautifulSoup
except ImportError:
print "HTML/json stuff not available, most features are now broken"