File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use crate::platform::sync::non_poison::Mutex;
22use crate :: { Py , PyAny } ;
33use alloc:: sync:: Arc ;
44use core:: future:: poll_fn;
5+ use core:: panic:: AssertUnwindSafe ;
56use core:: task:: { Context , Poll , Waker } ;
67
78#[ derive( Debug , Default ) ]
@@ -14,7 +15,7 @@ struct Inner {
1415///
1516/// Only the last exception thrown can be retrieved.
1617#[ derive( Debug , Default ) ]
17- pub struct CancelHandle ( Arc < Mutex < Inner > > ) ;
18+ pub struct CancelHandle ( Arc < AssertUnwindSafe < Mutex < Inner > > > ) ;
1819
1920impl CancelHandle {
2021 /// Create a new `CoroutineCancel`.
@@ -54,7 +55,7 @@ impl CancelHandle {
5455}
5556
5657#[ doc( hidden) ]
57- pub struct ThrowCallback ( Arc < Mutex < Inner > > ) ;
58+ pub struct ThrowCallback ( Arc < AssertUnwindSafe < Mutex < Inner > > > ) ;
5859
5960impl ThrowCallback {
6061 pub ( super ) fn throw ( & self , exc : Py < PyAny > ) {
You can’t perform that action at this time.
0 commit comments