Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
simplejson
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
simplejson
Commits
952e9d7b4a11
Commit
952e9d7b4a11
authored
12 years ago
by
Bob Ippolito
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Revert "Merge pull request #46 from cgohlke/patch-1""
This reverts commit 4d6b86059c981d1a275c803ecc91f511980b0af0.
parent
45fa35337bf9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
simplejson/_speedups.c
+6
-3
6 additions, 3 deletions
simplejson/_speedups.c
with
6 additions
and
3 deletions
simplejson/_speedups.c
+
6
−
3
View file @
952e9d7b
...
@@ -698,6 +698,7 @@
...
@@ -698,6 +698,7 @@
// item can be added as-is
// item can be added as-is
}
}
else
{
else
{
PyObject
*
tpl
;
kstr
=
encoder_stringify_key
(
s
,
key
);
kstr
=
encoder_stringify_key
(
s
,
key
);
if
(
kstr
==
NULL
)
if
(
kstr
==
NULL
)
goto
bail
;
goto
bail
;
...
@@ -709,7 +710,7 @@
...
@@ -709,7 +710,7 @@
value
=
PyTuple_GET_ITEM
(
item
,
1
);
value
=
PyTuple_GET_ITEM
(
item
,
1
);
if
(
value
==
NULL
)
if
(
value
==
NULL
)
goto
bail
;
goto
bail
;
PyObject
*
tpl
=
PyTuple_Pack
(
2
,
kstr
,
value
);
tpl
=
PyTuple_Pack
(
2
,
kstr
,
value
);
if
(
tpl
==
NULL
)
if
(
tpl
==
NULL
)
goto
bail
;
goto
bail
;
Py_CLEAR
(
kstr
);
Py_CLEAR
(
kstr
);
...
@@ -867,6 +868,7 @@
...
@@ -867,6 +868,7 @@
char
*
buf
=
PyString_AS_STRING
(
pystr
);
char
*
buf
=
PyString_AS_STRING
(
pystr
);
PyObject
*
chunks
=
NULL
;
PyObject
*
chunks
=
NULL
;
PyObject
*
chunk
=
NULL
;
PyObject
*
chunk
=
NULL
;
PyObject
*
strchunk
=
NULL
;
if
(
len
==
end
)
{
if
(
len
==
end
)
{
raise_errmsg
(
"Unterminated string starting at"
,
pystr
,
begin
);
raise_errmsg
(
"Unterminated string starting at"
,
pystr
,
begin
);
...
@@ -910,7 +912,7 @@
...
@@ -910,7 +912,7 @@
goto
bail
;
goto
bail
;
}
}
#else
/* PY_MAJOR_VERSION >= 3 */
#else
/* PY_MAJOR_VERSION >= 3 */
PyObject
*
strchunk
=
PyString_FromStringAndSize
(
&
buf
[
end
],
next
-
end
);
strchunk
=
PyString_FromStringAndSize
(
&
buf
[
end
],
next
-
end
);
if
(
strchunk
==
NULL
)
{
if
(
strchunk
==
NULL
)
{
goto
bail
;
goto
bail
;
}
}
...
@@ -2745,5 +2747,6 @@
...
@@ -2745,5 +2747,6 @@
rv
=
_steal_accumulate
(
rval
,
encoded
);
rv
=
_steal_accumulate
(
rval
,
encoded
);
}
}
else
if
(
s
->
namedtuple_as_object
&&
_is_namedtuple
(
obj
))
{
else
if
(
s
->
namedtuple_as_object
&&
_is_namedtuple
(
obj
))
{
PyObject
*
newobj
;
if
(
Py_EnterRecursiveCall
(
" while encoding a JSON object"
))
if
(
Py_EnterRecursiveCall
(
" while encoding a JSON object"
))
return
rv
;
return
rv
;
...
@@ -2748,6 +2751,6 @@
...
@@ -2748,6 +2751,6 @@
if
(
Py_EnterRecursiveCall
(
" while encoding a JSON object"
))
if
(
Py_EnterRecursiveCall
(
" while encoding a JSON object"
))
return
rv
;
return
rv
;
PyObject
*
newobj
=
PyObject_CallMethod
(
obj
,
"_asdict"
,
NULL
);
newobj
=
PyObject_CallMethod
(
obj
,
"_asdict"
,
NULL
);
if
(
newobj
!=
NULL
)
{
if
(
newobj
!=
NULL
)
{
rv
=
encoder_listencode_dict
(
s
,
rval
,
newobj
,
indent_level
);
rv
=
encoder_listencode_dict
(
s
,
rval
,
newobj
,
indent_level
);
Py_DECREF
(
newobj
);
Py_DECREF
(
newobj
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment