summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorbggardner <brent@ebrent.net>2019-09-12 10:02:48 (GMT)
committerBenjamin Peterson <benjamin@python.org>2019-09-12 10:02:48 (GMT)
commit954900a3f98a8c0dea14dd575490237f3f8626b3 (patch)
tree20376e6ee25b3d01c27e6294ddedb87ff050a03e /Lib/test/test_socket.py
parent64535fc6c0712caef0bc46be30e661f7ccf8280e (diff)
downloadcpython-954900a3f98a8c0dea14dd575490237f3f8626b3.zip
cpython-954900a3f98a8c0dea14dd575490237f3f8626b3.tar.gz
cpython-954900a3f98a8c0dea14dd575490237f3f8626b3.tar.bz2
closes bpo-37405: Make socket.getsockname() always return a tuple for AF_CAN. (GH-14392)
This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
Diffstat (limited to 'Lib/test/test_socket.py')
-rwxr-xr-xLib/test/test_socket.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index b855c52..b745490 100755
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1948,7 +1948,9 @@ class BasicCANTest(unittest.TestCase):
def testBindAny(self):
with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
- s.bind(('', ))
+ address = ('', )
+ s.bind(address)
+ self.assertEqual(s.getsockname(), address)
def testTooLongInterfaceName(self):
# most systems limit IFNAMSIZ to 16, take 1024 to be sure