mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Correct getnameinfo refcounting and tuple parsing. Fixes #476648.
This commit is contained in:
parent
6b45b1ee52
commit
06b1d21e7d
2 changed files with 18 additions and 6 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue