Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1bfdc78

Browse files
committed
Skip Montanaro: modify test_socket.py to listen/connect using loopback addr
1 parent be2211e commit 1bfdc78

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_socket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def missing_ok(str):
9797
if not canfork or os.fork():
9898
# parent is server
9999
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
100-
s.bind((hostname, PORT))
100+
s.bind(("127.0.0.1", PORT))
101101
s.listen(1)
102102
if verbose:
103103
print 'parent accepting'
@@ -133,7 +133,7 @@ def missing_ok(str):
133133
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
134134
if verbose:
135135
print 'child connecting'
136-
s.connect((hostname, PORT))
136+
s.connect(("127.0.0.1", PORT))
137137
msg = 'socket test'
138138
s.send(msg)
139139
data = s.recv(1024)

0 commit comments

Comments
 (0)