diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-13 04:18:24 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-13 04:18:24 (GMT) |
commit | 04c6423fbab6f4a525d56cedc91600a52d74f062 (patch) | |
tree | f6f0099cd34a142ddbc5f53569d46dadedc34cab /Lib/json/decoder.py | |
parent | 1a20c121ef3cfc53cf8ec754cbba8ef82933f175 (diff) | |
parent | d210aa1ad9329661625ca5f0b6754f84ffc25021 (diff) | |
download | cpython-04c6423fbab6f4a525d56cedc91600a52d74f062.zip cpython-04c6423fbab6f4a525d56cedc91600a52d74f062.tar.gz cpython-04c6423fbab6f4a525d56cedc91600a52d74f062.tar.bz2 |
Merge with 3.1.
Diffstat (limited to 'Lib/json/decoder.py')
-rw-r--r-- | Lib/json/decoder.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py index 5747fa6..a19cf0f 100644 --- a/Lib/json/decoder.py +++ b/Lib/json/decoder.py @@ -165,6 +165,12 @@ def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook, nextchar = s[end:end + 1] # Trivial empty object if nextchar == '}': + if object_pairs_hook is not None: + result = object_pairs_hook(pairs) + return result, end + pairs = {} + if object_hook is not None: + pairs = object_hook(pairs) return pairs, end + 1 elif nextchar != '"': raise ValueError(errmsg("Expecting property name", s, end)) |