Commit f1062704 authored by Denis Bilenko's avatar Denis Bilenko

linking to a greenlet is now deprecated

parent 0d0aeb5f
......@@ -71,8 +71,11 @@ class GreenletLink(object):
Can be called only from main loop.
"""
__slots__ = ['greenlet']
_stacklevel = 3
def __init__(self, greenlet):
import warnings
warnings.warn('linking to greenlet is deprecated', DeprecationWarning, stacklevel=self._stacklevel)
self.greenlet = greenlet
def __call__(self, source):
......@@ -105,6 +108,7 @@ class SuccessGreenletLink(GreenletLink):
Can be called only from main loop.
"""
__slots__ = []
_stacklevel = 4
def __call__(self, source):
if source.successful():
......@@ -118,6 +122,7 @@ class FailureGreenletLink(GreenletLink):
Can be called only from main loop.
"""
__slots__ = []
_stacklevel = 4
def __call__(self, source):
if not source.successful():
......
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