@@ -4451,7 +4451,7 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
44514451 UNIX_PATH_MAX = 108
44524452
44534453 def testLinuxAbstractNamespace (self ):
4454- address = "\x00 python-test-hello\x00 \xff "
4454+ address = b "\x00 python-test-hello\x00 \xff "
44554455 with socket .socket (socket .AF_UNIX , socket .SOCK_STREAM ) as s1 :
44564456 s1 .bind (address )
44574457 s1 .listen (1 )
@@ -4462,7 +4462,7 @@ def testLinuxAbstractNamespace(self):
44624462 self .assertEqual (s2 .getpeername (), address )
44634463
44644464 def testMaxName (self ):
4465- address = "\x00 " + "h" * (self .UNIX_PATH_MAX - 1 )
4465+ address = b "\x00 " + b "h" * (self .UNIX_PATH_MAX - 1 )
44664466 with socket .socket (socket .AF_UNIX , socket .SOCK_STREAM ) as s :
44674467 s .bind (address )
44684468 self .assertEqual (s .getsockname (), address )
@@ -4472,12 +4472,12 @@ def testNameOverflow(self):
44724472 with socket .socket (socket .AF_UNIX , socket .SOCK_STREAM ) as s :
44734473 self .assertRaises (OSError , s .bind , address )
44744474
4475- def testBytesName (self ):
4476- # Check that an abstract name can be passed as bytes .
4475+ def testStrName (self ):
4476+ # Check that an abstract name can be passed as a string .
44774477 s = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
44784478 try :
4479- s .bind (b "\x00 python\x00 test\x00 " )
4480- self .assertEqual (s .getsockname (), "\x00 python\x00 test\x00 " )
4479+ s .bind ("\x00 python\x00 test\x00 " )
4480+ self .assertEqual (s .getsockname (), b "\x00 python\x00 test\x00 " )
44814481 finally :
44824482 s .close ()
44834483
0 commit comments