File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -596,15 +596,11 @@ where
596
596
let future_tx1: Py < PyAny > = py_fut. clone ( ) . into ( ) ;
597
597
let future_tx2 = future_tx1. clone_ref ( py) ;
598
598
599
- R :: spawn ( async move {
600
- let locals2 = Python :: attach ( |py| locals. clone_ref ( py) ) ;
599
+ let ( locals2, locals3) = Python :: attach ( |py| ( locals. clone_ref ( py) , locals. clone_ref ( py) ) ) ;
601
600
601
+ R :: spawn ( async move {
602
602
if let Err ( e) = R :: spawn ( async move {
603
- let result = R :: scope (
604
- Python :: attach ( |py| locals2. clone_ref ( py) ) ,
605
- Cancellable :: new_with_cancel_rx ( fut, cancel_rx) ,
606
- )
607
- . await ;
603
+ let result = R :: scope ( locals2, Cancellable :: new_with_cancel_rx ( fut, cancel_rx) ) . await ;
608
604
609
605
Python :: attach ( move |py| {
610
606
if cancelled ( future_tx1. bind ( py) )
@@ -615,7 +611,7 @@ where
615
611
}
616
612
617
613
let _ = set_result (
618
- & locals2 . event_loop ( py) ,
614
+ & locals3 . event_loop ( py) ,
619
615
future_tx1. bind ( py) ,
620
616
result. and_then ( |val| val. into_py_any ( py) ) ,
621
617
)
You can’t perform that action at this time.
0 commit comments