@@ -273,9 +273,9 @@ mod tests {
273
273
pyo3:: prepare_freethreaded_python ( ) ;
274
274
275
275
Python :: with_gil ( |py| {
276
- let template_string = PyString :: new_bound ( py, "" ) ;
276
+ let template_string = PyString :: new ( py, "" ) ;
277
277
let template = Template :: from_string ( template_string) . unwrap ( ) ;
278
- let context = PyDict :: new_bound ( py) ;
278
+ let context = PyDict :: new ( py) ;
279
279
280
280
assert_eq ! ( template. render( py, Some ( context) , None ) . unwrap( ) , "" ) ;
281
281
} )
@@ -286,9 +286,9 @@ mod tests {
286
286
pyo3:: prepare_freethreaded_python ( ) ;
287
287
288
288
Python :: with_gil ( |py| {
289
- let template_string = PyString :: new_bound ( py, "Hello {{ user }}!" ) ;
289
+ let template_string = PyString :: new ( py, "Hello {{ user }}!" ) ;
290
290
let template = Template :: from_string ( template_string) . unwrap ( ) ;
291
- let context = PyDict :: new_bound ( py) ;
291
+ let context = PyDict :: new ( py) ;
292
292
context. set_item ( "user" , "Lily" ) . unwrap ( ) ;
293
293
294
294
assert_eq ! (
@@ -303,9 +303,9 @@ mod tests {
303
303
pyo3:: prepare_freethreaded_python ( ) ;
304
304
305
305
Python :: with_gil ( |py| {
306
- let template_string = PyString :: new_bound ( py, "Hello {{ user }}!" ) ;
306
+ let template_string = PyString :: new ( py, "Hello {{ user }}!" ) ;
307
307
let template = Template :: from_string ( template_string) . unwrap ( ) ;
308
- let context = PyDict :: new_bound ( py) ;
308
+ let context = PyDict :: new ( py) ;
309
309
310
310
assert_eq ! ( template. render( py, Some ( context) , None ) . unwrap( ) , "Hello !" ) ;
311
311
} )
@@ -316,11 +316,11 @@ mod tests {
316
316
pyo3:: prepare_freethreaded_python ( ) ;
317
317
318
318
Python :: with_gil ( |py| {
319
- let template_string = PyString :: new_bound ( py, "Hello {{ user.profile.names.0 }}!" ) ;
319
+ let template_string = PyString :: new ( py, "Hello {{ user.profile.names.0 }}!" ) ;
320
320
let template = Template :: from_string ( template_string) . unwrap ( ) ;
321
- let locals = PyDict :: new_bound ( py) ;
322
- py. run_bound (
323
- r #"
321
+ let locals = PyDict :: new ( py) ;
322
+ py. run (
323
+ cr #"
324
324
class User:
325
325
def __init__(self, names):
326
326
self.profile = {"names": names}
@@ -332,7 +332,7 @@ user = User(["Lily"])
332
332
)
333
333
. unwrap ( ) ;
334
334
let user = locals. get_item ( "user" ) . unwrap ( ) . unwrap ( ) ;
335
- let context = PyDict :: new_bound ( py) ;
335
+ let context = PyDict :: new ( py) ;
336
336
context. set_item ( "user" , user. into_any ( ) ) . unwrap ( ) ;
337
337
338
338
assert_eq ! (
@@ -361,9 +361,9 @@ user = User(["Lily"])
361
361
false ,
362
362
)
363
363
. unwrap ( ) ;
364
- let template_string = PyString :: new_bound ( py, "Hello {{ user }}!" ) ;
364
+ let template_string = PyString :: new ( py, "Hello {{ user }}!" ) ;
365
365
let template = engine. from_string ( template_string) . unwrap ( ) ;
366
- let context = PyDict :: new_bound ( py) ;
366
+ let context = PyDict :: new ( py) ;
367
367
368
368
assert_eq ! ( template. render( py, Some ( context) , None ) . unwrap( ) , "Hello !" ) ;
369
369
} )
0 commit comments