Skip to content
Snippets Groups Projects
Commit 15c5ffa638c9 authored by Bob Ippolito's avatar Bob Ippolito
Browse files

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
from __future__ import with_statement
import os
import sys
import textwrap
......@@ -45,7 +46,7 @@
stderr=subprocess.PIPE,
stdout=subprocess.PIPE)
out, err = proc.communicate(data)
self.assertEqual(len(err), 0)
self.assertEqual(err, ''.encode())
self.assertEqual(proc.returncode, 0)
return out
......@@ -68,7 +69,7 @@
infile.flush()
# outfile will get overwritten by tool, so the delete
# may not work on some platforms. Do it manually.
outfile = tempfile.NamedTemporaryFile(delete=0)
outfile = tempfile.NamedTemporaryFile()
try:
self.assertEqual(
self.runTool(args=[infile.name, outfile.name]),
......@@ -77,4 +78,5 @@
self.assertEqual(f.read(), self.expect.encode())
finally:
outfile.close()
if os.path.exists(outfile.name):
os.unlink(outfile.name)
......@@ -10,6 +10,7 @@
Expecting property name: line 1 column 2 (char 2)
"""
from __future__ import with_statement
import sys
import simplejson as json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment