File tree Expand file tree Collapse file tree 4 files changed +24
-27
lines changed Expand file tree Collapse file tree 4 files changed +24
-27
lines changed Original file line number Diff line number Diff line change @@ -149,12 +149,12 @@ async fn test_cancel() -> PyResult<()> {
149
149
. await
150
150
{
151
151
Python :: with_gil ( |py| -> PyResult < ( ) > {
152
- assert ! ( py
153
- . import( "asyncio" ) ?
154
- . getattr( "CancelledError" ) ?
155
- . downcast:: <PyType >( )
156
- . unwrap( )
157
- . is_instance ( e . pvalue ( py ) ) ?) ;
152
+ assert ! ( e . value ( py ) . is_instance (
153
+ py . import( "asyncio" ) ?
154
+ . getattr( "CancelledError" ) ?
155
+ . downcast:: <PyType >( )
156
+ . unwrap( )
157
+ ) ?) ;
158
158
Ok ( ( ) )
159
159
} ) ?;
160
160
} else {
@@ -195,12 +195,12 @@ fn test_local_cancel(event_loop: PyObject) -> PyResult<()> {
195
195
. await
196
196
{
197
197
Python :: with_gil ( |py| -> PyResult < ( ) > {
198
- assert ! ( py
199
- . import( "asyncio" ) ?
200
- . getattr( "CancelledError" ) ?
201
- . downcast:: <PyType >( )
202
- . unwrap( )
203
- . is_instance ( e . pvalue ( py ) ) ?) ;
198
+ assert ! ( e . value ( py ) . is_instance (
199
+ py . import( "asyncio" ) ?
200
+ . getattr( "CancelledError" ) ?
201
+ . downcast:: <PyType >( )
202
+ . unwrap( )
203
+ ) ?) ;
204
204
Ok ( ( ) )
205
205
} ) ?;
206
206
} else {
@@ -319,7 +319,6 @@ fn test_contextvars() -> PyResult<()> {
319
319
} )
320
320
}
321
321
322
- #[ allow( deprecated) ]
323
322
fn main ( ) -> pyo3:: PyResult < ( ) > {
324
323
pyo3:: prepare_freethreaded_python ( ) ;
325
324
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ mod tokio_asyncio;
3
3
4
4
use pyo3:: prelude:: * ;
5
5
6
- #[ allow( deprecated) ]
7
6
fn main ( ) -> pyo3:: PyResult < ( ) > {
8
7
pyo3:: prepare_freethreaded_python ( ) ;
9
8
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ mod tokio_asyncio;
3
3
4
4
use pyo3:: prelude:: * ;
5
5
6
- #[ allow( deprecated) ]
7
6
fn main ( ) -> pyo3:: PyResult < ( ) > {
8
7
pyo3:: prepare_freethreaded_python ( ) ;
9
8
Original file line number Diff line number Diff line change @@ -152,12 +152,12 @@ async fn test_cancel() -> PyResult<()> {
152
152
. await
153
153
{
154
154
Python :: with_gil ( |py| -> PyResult < ( ) > {
155
- assert ! ( py
156
- . import( "asyncio" ) ?
157
- . getattr( "CancelledError" ) ?
158
- . downcast:: <PyType >( )
159
- . unwrap( )
160
- . is_instance ( e . pvalue ( py ) ) ?) ;
155
+ assert ! ( e . value ( py ) . is_instance (
156
+ py . import( "asyncio" ) ?
157
+ . getattr( "CancelledError" ) ?
158
+ . downcast:: <PyType >( )
159
+ . unwrap( )
160
+ ) ?) ;
161
161
Ok ( ( ) )
162
162
} ) ?;
163
163
} else {
@@ -199,12 +199,12 @@ fn test_local_cancel(event_loop: PyObject) -> PyResult<()> {
199
199
. await
200
200
{
201
201
Python :: with_gil ( |py| -> PyResult < ( ) > {
202
- assert ! ( py
203
- . import( "asyncio" ) ?
204
- . getattr( "CancelledError" ) ?
205
- . downcast:: <PyType >( )
206
- . unwrap( )
207
- . is_instance ( e . pvalue ( py ) ) ?) ;
202
+ assert ! ( e . value ( py ) . is_instance (
203
+ py . import( "asyncio" ) ?
204
+ . getattr( "CancelledError" ) ?
205
+ . downcast:: <PyType >( )
206
+ . unwrap( )
207
+ ) ?) ;
208
208
Ok ( ( ) )
209
209
} ) ?;
210
210
} else {
You can’t perform that action at this time.
0 commit comments