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
15c5ffa638c9
Commit
15c5ffa638c9
authored
12 years ago
by
Bob Ippolito
Browse files
Options
Downloads
Patches
Plain Diff
fix python 2.5 regression in tool and test_tool
parent
6f3aec782117
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
simplejson/tests/test_tool.py
+5
-3
5 additions, 3 deletions
simplejson/tests/test_tool.py
simplejson/tool.py
+1
-0
1 addition, 0 deletions
simplejson/tool.py
with
6 additions
and
3 deletions
simplejson/tests/test_tool.py
+
5
−
3
View file @
15c5ffa6
from
__future__
import
with_statement
import
os
import
os
import
sys
import
sys
import
textwrap
import
textwrap
...
@@ -45,7 +46,7 @@
...
@@ -45,7 +46,7 @@
stderr
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
)
out
,
err
=
proc
.
communicate
(
data
)
out
,
err
=
proc
.
communicate
(
data
)
self
.
assertEqual
(
len
(
err
)
,
0
)
self
.
assertEqual
(
err
,
''
.
encode
()
)
self
.
assertEqual
(
proc
.
returncode
,
0
)
self
.
assertEqual
(
proc
.
returncode
,
0
)
return
out
return
out
...
@@ -68,7 +69,7 @@
...
@@ -68,7 +69,7 @@
infile
.
flush
()
infile
.
flush
()
# outfile will get overwritten by tool, so the delete
# outfile will get overwritten by tool, so the delete
# may not work on some platforms. Do it manually.
# may not work on some platforms. Do it manually.
outfile
=
tempfile
.
NamedTemporaryFile
(
delete
=
0
)
outfile
=
tempfile
.
NamedTemporaryFile
()
try
:
try
:
self
.
assertEqual
(
self
.
assertEqual
(
self
.
runTool
(
args
=
[
infile
.
name
,
outfile
.
name
]),
self
.
runTool
(
args
=
[
infile
.
name
,
outfile
.
name
]),
...
@@ -77,4 +78,5 @@
...
@@ -77,4 +78,5 @@
self
.
assertEqual
(
f
.
read
(),
self
.
expect
.
encode
())
self
.
assertEqual
(
f
.
read
(),
self
.
expect
.
encode
())
finally
:
finally
:
outfile
.
close
()
outfile
.
close
()
if
os
.
path
.
exists
(
outfile
.
name
):
os
.
unlink
(
outfile
.
name
)
os
.
unlink
(
outfile
.
name
)
This diff is collapsed.
Click to expand it.
simplejson/tool.py
+
1
−
0
View file @
15c5ffa6
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
Expecting property name: line 1 column 2 (char 2)
Expecting property name: line 1 column 2 (char 2)
"""
"""
from
__future__
import
with_statement
import
sys
import
sys
import
simplejson
as
json
import
simplejson
as
json
...
...
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