Skip to content

Commit 15d6158

Browse files
author
James Graham
committed
Merge
2 parents 88381e8 + 5711c88 commit 15d6158

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

html5lib/tests/test_tokenizer.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
import warnings
66
import re
77

8-
from support import simplejson, html5lib_test_files
8+
try:
9+
import json
10+
except ImportError:
11+
import simplejson as json
912

13+
from support import html5lib_test_files
1014
from html5lib.tokenizer import HTMLTokenizer
1115
from html5lib import constants
1216

@@ -82,7 +86,7 @@ def normalizeTokens(tokens):
8286
for i, token in enumerate(tokens):
8387
if token[0] == u'ParseError':
8488
tokens[i] = token[0]
85-
return simplejson.loads(simplejson.dumps(tokens))
89+
return json.loads(json.dumps(tokens))
8690

8791
def tokensMatch(expectedTokens, receivedTokens, ignoreErrorOrder):
8892
"""Test whether the test has passed or failed
@@ -158,7 +162,7 @@ def capitalize(s):
158162
def buildTestSuite():
159163
for filename in html5lib_test_files('tokenizer', '*.test'):
160164
print filename
161-
tests = simplejson.load(file(filename))
165+
tests = json.load(file(filename))
162166
testName = os.path.basename(filename).replace(".test","")
163167
if 'tests' in tests:
164168
for index,test in enumerate(tests['tests']):

0 commit comments

Comments
 (0)