Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
e05b717f
Commit
e05b717f
authored
Mar 18, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sendmsg/recvmsg tests on OS X.
parent
7b3f3501
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
gevent/_socket3.py
gevent/_socket3.py
+15
-4
greentest/patched_tests_setup.py
greentest/patched_tests_setup.py
+14
-0
No files found.
gevent/_socket3.py
View file @
e05b717f
...
...
@@ -50,9 +50,6 @@ class _wrefsocket(_socket.socket):
__slots__
=
(
"__weakref__"
,
)
_closedsocket
=
_wrefsocket
()
_closedsocket
.
close
()
class
socket
(
object
):
"""
...
...
@@ -243,7 +240,21 @@ class socket(object):
self
.
hub
.
cancel_wait
(
self
.
_read_event
,
cancel_wait_ex
)
self
.
hub
.
cancel_wait
(
self
.
_write_event
,
cancel_wait_ex
)
_ss
.
close
(
self
.
_sock
)
self
.
_sock
=
_closedsocket
# Break any references to the underlying socket object. Tested
# by test__refcount. (Why does this matter?). Be sure to
# preserve our same family/type/proto if possible (if we
# don't, we can get TypeError instead of OSError; see
# test_socket.SendmsgUDP6Test.testSendmsgAfterClose)... but
# this isn't always possible (see test_socket.test_unknown_socket_family_repr)
# TODO: Can we use a simpler proxy, like _socket2 does?
try
:
self
.
_sock
=
self
.
_gevent_sock_class
(
self
.
family
,
self
.
type
,
self
.
proto
)
except
OSError
:
pass
else
:
_ss
.
close
(
self
.
_sock
)
def
close
(
self
):
# This function should not reference any globals. See Python issue #808164.
...
...
greentest/patched_tests_setup.py
View file @
e05b717f
...
...
@@ -396,6 +396,13 @@ if sys.version_info[:2] >= (3, 4):
]
if
sys
.
platform
==
'darwin'
:
disabled_tests
+=
[
# These raise "OSError: 12 Cannot allocate memory" on both
# patched and unpatched runs
'test_socket.RecvmsgSCMRightsStreamTest.testFDPassEmpty'
,
]
if
sys
.
version_info
[:
2
]
==
(
3
,
4
):
disabled_tests
+=
[
# These are all expecting that a signal (sigalarm) that
...
...
@@ -413,6 +420,8 @@ if sys.version_info[:2] >= (3, 4):
'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvfromTimeout'
,
'test_socket.InterruptedRecvTimeoutTest.testInterruptedSendTimeout'
,
'test_socket.InterruptedRecvTimeoutTest.testInterruptedSendtoTimeout'
,
'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvmsgTimeout'
,
'test_socket.InterruptedSendTimeoutTest.testInterruptedSendmsgTimeout'
,
]
if
os
.
environ
.
get
(
'TRAVIS'
)
==
'true'
:
...
...
@@ -454,6 +463,10 @@ if sys.version_info[:2] >= (3, 5):
def
disable_tests_in_source
(
source
,
name
):
if
name
.
startswith
(
'./'
):
# turn "./test_socket.py" (used for auto-complete) into "test_socket.py"
name
=
name
[
2
:]
my_disabled_tests
=
[
x
for
x
in
disabled_tests
if
x
.
startswith
(
name
+
'.'
)]
if
not
my_disabled_tests
:
return
source
...
...
@@ -462,4 +475,5 @@ def disable_tests_in_source(source, name):
testcase
=
test
.
split
(
'.'
)[
-
1
]
source
,
n
=
re
.
subn
(
testcase
,
'XXX'
+
testcase
,
source
)
print
(
'Removed %s (%d)'
%
(
testcase
,
n
),
file
=
sys
.
stderr
)
return
source
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