Skip to content

Commit

Permalink
make tests pass on UCS2 platforms
Browse files Browse the repository at this point in the history
git-svn-id: http://simplejson.googlecode.com/svn/trunk@74 a4795897-2c25-0410-b006-0d3caba88fa1
  • Loading branch information
etrepum committed Mar 23, 2008
1 parent 680f4ce commit 42a7e48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion simplejson/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Implementation of JSONDecoder
"""
import re
import sys

from simplejson.scanner import Scanner, pattern

Expand Down Expand Up @@ -112,7 +113,7 @@ def scanstring(s, end, encoding=None, _b=BACKSLASH, _m=STRINGCHUNK.match):
if len(esc) != 4 or not esc.isalnum():
raise ValueError
uni = int(esc, 16)
if 0xd800 <= uni <= 0xdbff:
if 0xd800 <= uni <= 0xdbff and sys.maxunicode > 65535:
msg = "Invalid \\uXXXX\\uXXXX surrogate pair"
if not s[end + 5:end + 7] == '\\u':
raise ValueError
Expand Down

0 comments on commit 42a7e48

Please sign in to comment.