Commit 368d6a91 authored by Jason Madden's avatar Jason Madden

Move the __weakref__ to the base class for Cython because we did see a failure...

Move the __weakref__ to the base class for Cython because we did see a failure in 3.6 too: https://travis-ci.org/gevent/gevent/jobs/379718754#L753
parent a6ee9283
......@@ -8,8 +8,7 @@
==================
- Fix weak references to :class:`gevent.event.Event`. Reported in
:issue:`1211` by Matias Guijarro. Note that creating weak references
to Event objects may crash Python 3.7.
:issue:`1211` by Matias Guijarro.
1.3.0 (2018-05-11)
......
......@@ -36,6 +36,11 @@ cdef inline void greenlet_init():
cdef void _init()
cdef class _AbstractLinkable:
# We declare the __weakref__ here in the base (even though
# that's not really what we want) as a workaround for a Cython
# issue we see reliably on 3.7b4 and sometimes on 3.6. See
# https://github.com/cython/cython/issues/2270
cdef object __weakref__
cdef _notifier
cdef set _links
cdef readonly SwitchOutGreenletWithLoop hub
......@@ -53,7 +58,6 @@ cdef class _AbstractLinkable:
cdef class Event(_AbstractLinkable):
cdef object __weakref__
cdef bint _flag
cdef class AsyncResult(_AbstractLinkable):
......
......@@ -238,13 +238,13 @@ class TestWait_count2(TestWait):
class TestEventBasics(greentest.TestCase):
@greentest.skipOnPy37("Cython crashes in this case. "
"See https://github.com/cython/cython/issues/2270")
def test_weakref(self):
# Event objects should allow weakrefs
e = Event()
r = weakref.ref(e)
self.assertIs(e, r())
del e
del r
del AbstractGenericGetTestCase
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment