Correct getnameinfo refcounting and tuple parsing. Fixes #476648.

This commit is contained in:
Martin v. Löwis 2001-11-02 23:34:52 +00:00
parent 6b45b1ee52
commit 06b1d21e7d
2 changed files with 18 additions and 6 deletions

View file

@ -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: