File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,22 @@ DEF _FUT_CANCELLED = 2
55DEF _FUT_FINISHED = 3
66
77
8+ cdef inline _future_get_blocking(fut):
9+ try :
10+ return fut._asyncio_future_blocking
11+ except AttributeError :
12+ return fut._blocking
13+
14+
15+ cdef inline _future_set_blocking(fut, val):
16+ try :
17+ fut._asyncio_future_blocking
18+ except AttributeError :
19+ fut._blocking = val
20+ else :
21+ fut._asyncio_future_blocking = val
22+
23+
824cdef class BaseFuture:
925 cdef:
1026 int _state
@@ -36,6 +52,13 @@ cdef class BaseFuture:
3652 else :
3753 self ._source_traceback = None
3854
55+ property _asyncio_future_blocking :
56+ def __get__ (self ):
57+ return self ._blocking
58+
59+ def __set__ (self , value ):
60+ self ._blocking = value
61+
3962 cdef _schedule_callbacks(self ):
4063 cdef:
4164 list callbacks
Original file line number Diff line number Diff line change @@ -156,8 +156,8 @@ cdef class BaseTask(BaseFuture):
156156 # Yielded Future must come from Future.__iter__().
157157 if result._loop is not self ._loop:
158158 self ._raise_wrong_loop(result)
159- elif result._blocking :
160- result._blocking = False
159+ elif _future_get_blocking( result) :
160+ _future_set_blocking( result, False )
161161 result.add_done_callback(self ._wakeup)
162162 self ._fut_waiter = result
163163 if self ._must_cancel:
You can’t perform that action at this time.
0 commit comments