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
5
5
DEF _FUT_FINISHED = 3
6
6
7
7
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
+
8
24
cdef class BaseFuture:
9
25
cdef:
10
26
int _state
@@ -36,6 +52,13 @@ cdef class BaseFuture:
36
52
else :
37
53
self ._source_traceback = None
38
54
55
+ property _asyncio_future_blocking :
56
+ def __get__ (self ):
57
+ return self ._blocking
58
+
59
+ def __set__ (self , value ):
60
+ self ._blocking = value
61
+
39
62
cdef _schedule_callbacks(self ):
40
63
cdef:
41
64
list callbacks
Original file line number Diff line number Diff line change @@ -156,8 +156,8 @@ cdef class BaseTask(BaseFuture):
156
156
# Yielded Future must come from Future.__iter__().
157
157
if result._loop is not self ._loop:
158
158
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 )
161
161
result.add_done_callback(self ._wakeup)
162
162
self ._fut_waiter = result
163
163
if self ._must_cancel:
You can’t perform that action at this time.
0 commit comments