Fall back to simplejson when the stdlib json module is not available

develop
Sven Slootweg 12 years ago
parent 727f150621
commit 82e4826dea

@ -1,8 +1,13 @@
#!/usr/bin/python #!/usr/bin/python
import os, time, sys, json, urllib, urllib2, threading, re import os, time, sys, urllib, urllib2, threading, re
from collections import deque from collections import deque
from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulSoup
try:
import json
except:
import simplejson as json
STOP = False STOP = False
pipe_name = 'pipe_books' pipe_name = 'pipe_books'

@ -1,5 +1,10 @@
#!/usr/bin/python #!/usr/bin/python
import os, time, sys, json, _mysql import os, time, sys, _mysql
try:
import json
except:
import simplejson as json
def stringdammit(input_string): def stringdammit(input_string):
if isinstance(input_string, str): if isinstance(input_string, str):

Loading…
Cancel
Save