diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-05-29 18:57:42 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-05-29 18:57:42 (GMT) |
commit | 812d8341ea75d39d481bccfbfb03f7ee8626a47a (patch) | |
tree | 833031bd6e0c9c030eb699547971794eac9bf52f /Lib/test/test_pty.py | |
parent | c02571484b5d4b7f1efcc65b8a8b896ab8740dfd (diff) | |
download | cpython-812d8341ea75d39d481bccfbfb03f7ee8626a47a.zip cpython-812d8341ea75d39d481bccfbfb03f7ee8626a47a.tar.gz cpython-812d8341ea75d39d481bccfbfb03f7ee8626a47a.tar.bz2 |
Fix test_pty.py.
Diffstat (limited to 'Lib/test/test_pty.py')
-rw-r--r-- | Lib/test/test_pty.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index 245a9e4..b153ae7 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -30,12 +30,12 @@ def normalize_output(data): # from someone more knowledgable. # OSF/1 (Tru64) apparently turns \n into \r\r\n. - if data.endswith('\r\r\n'): - return data.replace('\r\r\n', '\n') + if data.endswith(b'\r\r\n'): + return data.replace(b'\r\r\n', b'\n') # IRIX apparently turns \n into \r\n. - if data.endswith('\r\n'): - return data.replace('\r\n', '\n') + if data.endswith(b'\r\n'): + return data.replace(b'\r\n', b'\n') return data @@ -92,14 +92,14 @@ class PtyTest(unittest.TestCase): debug("Writing to slave_fd") os.write(slave_fd, TEST_STRING_1) s1 = os.read(master_fd, 1024) - self.assertEquals('I wish to buy a fish license.\n', + self.assertEquals(b'I wish to buy a fish license.\n', normalize_output(s1)) debug("Writing chunked output") os.write(slave_fd, TEST_STRING_2[:5]) os.write(slave_fd, TEST_STRING_2[5:]) s2 = os.read(master_fd, 1024) - self.assertEquals('For my pet fish, Eric.\n', normalize_output(s2)) + self.assertEquals(b'For my pet fish, Eric.\n', normalize_output(s2)) os.close(slave_fd) os.close(master_fd) @@ -157,7 +157,7 @@ class PtyTest(unittest.TestCase): break if not data: break - sys.stdout.write(data.replace('\r\n', '\n')) + sys.stdout.write(data.replace('\r\n', '\n').decode('ascii')) ##line = os.read(master_fd, 80) ##lines = line.replace('\r\n', '\n').split('\n') |