Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
df61f6ab
Commit
df61f6ab
authored
Oct 30, 2017
by
R W H Bricheno
Committed by
David Wilson
Mar 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent MacOS exception on shutdown of closed socket.
parent
39f325af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
tests/testlib.py
tests/testlib.py
+15
-1
No files found.
tests/testlib.py
View file @
df61f6ab
...
...
@@ -83,7 +83,21 @@ def wait_for_port(
found
=
True
break
sock
.
shutdown
(
socket
.
SHUT_RDWR
)
try
:
sock
.
shutdown
(
socket
.
SHUT_RDWR
)
except
socket
.
error
,
e
:
# On Mac OS X - a BSD variant - the above code only succeeds if the operating system thinks that the
# socket is still open when shutdown() is invoked. If Python is too slow and the FIN packet arrives
# before that statement can be reached, then OS X kills the sock.shutdown() statement with:
#
# socket.error: [Errno 57] Socket is not connected
#
# Protect shutdown() with a try...except that catches the socket.error, test to make sure Errno is
# right, and ignore it if Errno matches.
if
e
.
errno
==
57
:
pass
else
:
raise
sock
.
close
()
if
found
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment