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
6e48b5c0
Commit
6e48b5c0
authored
Jun 29, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround bug in python 3.4 <= 3.4.2 with SocketType and socket.type
parent
4fe1dadc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
gevent/_socket3.py
gevent/_socket3.py
+14
-2
No files found.
gevent/_socket3.py
View file @
6e48b5c0
# Port of Python 3.3's socket module to gevent
import
io
import
sys
import
time
from
gevent
import
_socketcommon
import
_socket
...
...
@@ -379,8 +380,19 @@ class socket(object):
self
.
hub
.
cancel_wait
(
self
.
_write_event
,
cancel_wait_ex
)
self
.
_sock
.
shutdown
(
how
)
SocketType
=
socket
if
sys
.
version_info
[:
2
]
==
(
3
,
4
)
and
sys
.
version_info
[:
3
]
<=
(
3
,
4
,
2
):
# Python 3.4, up to and including 3.4.2, had a bug where the
# SocketType enumeration overwrote the SocketType class imported
# from _socket. This was fixed in 3.4.3 (http://bugs.python.org/issue20386
# and https://github.com/python/cpython/commit/0d2f85f38a9691efdfd1e7285c4262cab7f17db7).
# Prior to that, if we replace SocketType with our own class, the implementation
# of socket.type breaks with "OSError: [Errno 97] Address family not supported by protocol".
# Therefore, on these old versions, we must preserve it as an enum; while this
# seems like it could lead to non-green behaviour, code on those versions
# cannot possibly be using SocketType as a class anyway.
SocketType
=
__socket__
.
SocketType
else
:
SocketType
=
socket
def
fromfd
(
fd
,
family
,
type
,
proto
=
0
):
...
...
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