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
e00c797c
Commit
e00c797c
authored
Nov 18, 2019
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test__ssl on Python 3.6-7.2
parent
2fdc6af8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/gevent/tests/test__ssl.py
src/gevent/tests/test__ssl.py
+7
-2
No files found.
src/gevent/tests/test__ssl.py
View file @
e00c797c
...
...
@@ -9,6 +9,8 @@ import gevent.testing as greentest
from
gevent.tests
import
test__socket
import
ssl
from
gevent.testing
import
PY2
def
ssl_listener
(
private_key
,
certificate
):
raw_listener
=
socket
.
socket
()
greentest
.
bind_and_listen
(
raw_listener
)
...
...
@@ -24,8 +26,11 @@ class TestSSL(test__socket.TestTCP):
# ssl.SSLError); That's gone in Py3 though. In Python 2, most timeouts are raised
# as SSLError, but Python 3 raises the normal socket.timeout instead. So this has
# the effect of making TIMEOUT_ERROR be SSLError on Py2 and socket.timeout on Py3
# See https://bugs.python.org/issue10272
TIMEOUT_ERROR
=
getattr
(
socket
,
'sslerror'
,
socket
.
timeout
)
# See https://bugs.python.org/issue10272.
# PyPy3 7.2 has a bug, though: it shares much of the SSL implementation with Python 2,
# and it unconditionally does `socket.sslerror = SSLError` when ssl is imported.
# So we can't rely on getattr/hasattr tests, we must be explicit.
TIMEOUT_ERROR
=
socket
.
sslerror
if
PY2
else
socket
.
timeout
# pylint:disable=no-member
def
_setup_listener
(
self
):
listener
,
raw_listener
=
ssl_listener
(
self
.
privfile
,
self
.
certfile
)
...
...
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