]> granicus.if.org Git - python/commitdiff
Fix test failures caused by missing/incorrect conversion to bytes.
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 29 Aug 2007 14:56:40 +0000 (14:56 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 29 Aug 2007 14:56:40 +0000 (14:56 +0000)
Lib/test/test_asynchat.py

index be8e116fdc3e5a65514d673eda0d1e1e5c9e15d7..78f58683e2bb464f0455aebb883c52a738023be8 100644 (file)
@@ -90,8 +90,8 @@ class TestAsynchat(unittest.TestCase):
         time.sleep(0.5) # Give server time to initialize
         c = echo_client(term)
         c.push(b"hello ")
-        c.push(bytes("world%s" % term))
-        c.push(bytes("I'm not dead yet!%s" % term))
+        c.push(bytes("world%s" % term, "ascii"))
+        c.push(bytes("I'm not dead yet!%s" % term, "ascii"))
         c.push(SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
         s.join()
@@ -185,7 +185,7 @@ class TestAsynchat(unittest.TestCase):
         s.start()
         time.sleep(0.5) # Give server time to initialize
         c = echo_client(b'\n')
-        c.push("hello world\n\nI'm not dead yet!\n")
+        c.push(b"hello world\n\nI'm not dead yet!\n")
         c.push(SERVER_QUIT)
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
         s.join()
@@ -198,7 +198,7 @@ class TestAsynchat(unittest.TestCase):
         s.start()
         time.sleep(0.5) # Give server time to initialize
         c = echo_client(b'\n')
-        c.push("hello world\nI'm not dead yet!\n")
+        c.push(b"hello world\nI'm not dead yet!\n")
         c.push(SERVER_QUIT)
         c.close_when_done()
         asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)