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
b86561ba
Commit
b86561ba
authored
Mar 02, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests on Python 3.4: It doesn't have SSLObject.
parent
4324fad0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
src/gevent/_ssl3.py
src/gevent/_ssl3.py
+17
-11
src/greentest/test__local.py
src/greentest/test__local.py
+6
-4
No files found.
src/gevent/_ssl3.py
View file @
b86561ba
...
...
@@ -137,8 +137,14 @@ class _contextawaresock(socket._gevent_sock_class): # Python 2: pylint:disable=s
pass
raise
AttributeError
(
name
)
_SSLObject_factory
=
SSLObject
if
hasattr
(
SSLObject
,
'_create'
):
try
:
_SSLObject_factory
=
SSLObject
except
NameError
:
# 3.4 and below do not have SSLObject, something
# we magically import through copy_globals
pass
else
:
if
hasattr
(
SSLObject
,
'_create'
):
# 3.7 is making thing difficult and won't let you
# actually construct an object
def
_SSLObject_factory
(
sslobj
,
owner
=
None
,
session
=
None
):
...
...
src/greentest/test__local.py
View file @
b86561ba
...
...
@@ -274,7 +274,10 @@ class TestGeventLocal(greentest.TestCase):
# The sentinels should be gone too
self
.
assertEqual
(
len
(
deleted_sentinels
),
len
(
greenlets
))
@
greentest
.
skipOnLibuvOnPyPyOnWin
(
"GC makes this non-deterministic, especially on Windows"
)
def
test_locals_collected_when_unreferenced_even_in_running_greenlet
(
self
):
# In fact only on Windows do we see GC being an issue;
# pypy2 5.0 on macos and travis don't have a problem.
# https://github.com/gevent/gevent/issues/981
import
gevent
import
gc
...
...
@@ -308,17 +311,16 @@ class TestGeventLocal(greentest.TestCase):
self
.
assertEqual
(
count
,
len
(
deleted_sentinels
))
@
greentest
.
skipOnPyPy
(
"GC makes this non-deterministic, especially on Windows"
)
def
test_local_dicts_for_greenlet
(
self
):
# In fact, only on Windows do we see gc being an issue;
# pypy2 5.10 on macOS and Travis don't have a problem.
import
gevent
from
gevent.local
import
all_local_dicts_for_greenlet
x
=
MyLocal
()
x
.
foo
=
42
del
x
.
sentinel
if
greentest
.
PYPY
:
import
gc
gc
.
collect
()
results
=
all_local_dicts_for_greenlet
(
gevent
.
getcurrent
())
self
.
assertEqual
(
results
,
[((
MyLocal
,
id
(
x
)),
{
'foo'
:
42
})])
...
...
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