summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-29 03:47:36 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-29 03:47:36 (GMT)
commita1c42a92dbe147a1157e840d27adeb373c544044 (patch)
treeeee04dfd30fa99543db007d98bdeea5aced0fc8a /Lib
parenta8be92b6490f3e14581a18620f146016a1230125 (diff)
downloadcpython-a1c42a92dbe147a1157e840d27adeb373c544044.zip
cpython-a1c42a92dbe147a1157e840d27adeb373c544044.tar.gz
cpython-a1c42a92dbe147a1157e840d27adeb373c544044.tar.bz2
Make test_cmd_line work with strict str/bytes.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_cmd_line.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 441df09..7d4f2ab 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -35,7 +35,7 @@ class CmdLineTest(unittest.TestCase):
def verify_valid_flag(self, cmd_line):
data = self.start_python(cmd_line)
- self.assertTrue(data == b'' or data.endswith('\n'))
+ self.assertTrue(data == b'' or data.endswith(b'\n'))
self.assertTrue(b'Traceback' not in data)
def test_environment(self):
@@ -58,7 +58,7 @@ class CmdLineTest(unittest.TestCase):
self.assertTrue(b'usage' in self.start_python('-h'))
def test_version(self):
- version = 'Python %d.%d' % sys.version_info[:2]
+ version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii")
self.assertTrue(self.start_python('-V').startswith(version))
def test_run_module(self):
@@ -84,8 +84,8 @@ class CmdLineTest(unittest.TestCase):
# Runs the timeit module and checks the __main__
# namespace has been populated appropriately
p = _spawn_python('-i', '-m', 'timeit', '-n', '1')
- p.stdin.write('Timer\n')
- p.stdin.write('exit()\n')
+ p.stdin.write(b'Timer\n')
+ p.stdin.write(b'exit()\n')
data = _kill_python(p)
self.assertTrue(data.find(b'1 loop') != -1)
self.assertTrue(data.find(b'__main__.Timer') != -1)