|
5 | 5 | importwarnings
|
6 | 6 | importre
|
7 | 7 |
|
8 |
| -fromsupportimportsimplejson,html5lib_test_files |
| 8 | +try: |
| 9 | +importjson |
| 10 | +exceptImportError: |
| 11 | +importsimplejsonasjson |
9 | 12 |
|
| 13 | +fromsupportimporthtml5lib_test_files |
10 | 14 | fromhtml5lib.tokenizerimportHTMLTokenizer
|
11 | 15 | fromhtml5libimportconstants
|
12 | 16 |
|
@@ -82,7 +86,7 @@ def normalizeTokens(tokens):
|
82 | 86 | fori,tokeninenumerate(tokens):
|
83 | 87 | iftoken[0]==u'ParseError':
|
84 | 88 | tokens[i]=token[0]
|
85 |
| -returnsimplejson.loads(simplejson.dumps(tokens)) |
| 89 | +returnjson.loads(json.dumps(tokens)) |
86 | 90 |
|
87 | 91 | deftokensMatch(expectedTokens,receivedTokens,ignoreErrorOrder):
|
88 | 92 | """Test whether the test has passed or failed
|
@@ -158,7 +162,7 @@ def capitalize(s):
|
158 | 162 | defbuildTestSuite():
|
159 | 163 | forfilenameinhtml5lib_test_files('tokenizer','*.test'):
|
160 | 164 | printfilename
|
161 |
| -tests=simplejson.load(file(filename)) |
| 165 | +tests=json.load(file(filename)) |
162 | 166 | testName=os.path.basename(filename).replace(".test","")
|
163 | 167 | if'tests'intests:
|
164 | 168 | forindex,testinenumerate(tests['tests']):
|
|