summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-11-02 23:34:52 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-11-02 23:34:52 (GMT)
commit06b1d21e7d33b2f77c05a7d8a1c51c1713f716ee (patch)
tree3f5b695ba6357fa2d324ac637d4340d8b9723643 /Lib/test/test_socket.py
parent6b45b1ee52091a0adf2abee3b244c0b0b69da6da (diff)
downloadcpython-06b1d21e7d33b2f77c05a7d8a1c51c1713f716ee.zip
cpython-06b1d21e7d33b2f77c05a7d8a1c51c1713f716ee.tar.gz
cpython-06b1d21e7d33b2f77c05a7d8a1c51c1713f716ee.tar.bz2
Correct getnameinfo refcounting and tuple parsing. Fixes #476648.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 1880b11..e923d82 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -90,6 +90,20 @@ if hasattr(socket, 'getservbyname'):
except socket.error:
pass
+try:
+ # On some versions, this loses a reference
+ import sys
+ orig = sys.getrefcount(__name__)
+ socket.getnameinfo(__name__,0)
+except SystemError:
+ if sys.getrefcount(__name__) <> orig:
+ raise TestFailed,"socket.getnameinfo loses a reference"
+
+try:
+ # On some versions, this crashes the interpreter.
+ socket.getnameinfo(('x', 0, 0, 0), 0)
+except socket.gaierror:
+ pass
canfork = hasattr(os, 'fork')
try: