@@ -106,12 +106,12 @@ impl FnType {
106
106
}
107
107
FnType :: FnClass => {
108
108
quote ! {
109
- let _slf = :: pyo3 :: types:: PyType :: from_type_ptr( _py, _slf as * mut :: pyo3 :: ffi:: PyTypeObject ) ;
109
+ let _slf = _pyo3 :: types:: PyType :: from_type_ptr( _py, _slf as * mut _pyo3 :: ffi:: PyTypeObject ) ;
110
110
}
111
111
}
112
112
FnType :: FnModule => {
113
113
quote ! {
114
- let _slf = _py. from_borrowed_ptr:: <:: pyo3 :: types:: PyModule >( _slf) ;
114
+ let _slf = _py. from_borrowed_ptr:: <_pyo3 :: types:: PyModule >( _slf) ;
115
115
}
116
116
}
117
117
}
@@ -141,13 +141,13 @@ impl SelfType {
141
141
pub fn receiver ( & self , cls : & syn:: Type , error_mode : ExtractErrorMode ) -> TokenStream {
142
142
let cell = match error_mode {
143
143
ExtractErrorMode :: Raise => {
144
- quote ! { _py. from_borrowed_ptr:: <:: pyo3 :: PyAny >( _slf) . downcast:: <:: pyo3 :: PyCell <#cls>>( ) ? }
144
+ quote ! { _py. from_borrowed_ptr:: <_pyo3 :: PyAny >( _slf) . downcast:: <_pyo3 :: PyCell <#cls>>( ) ? }
145
145
}
146
146
ExtractErrorMode :: NotImplemented => {
147
147
quote ! {
148
- match _py. from_borrowed_ptr:: <:: pyo3 :: PyAny >( _slf) . downcast:: <:: pyo3 :: PyCell <#cls>>( ) {
148
+ match _py. from_borrowed_ptr:: <_pyo3 :: PyAny >( _slf) . downcast:: <_pyo3 :: PyCell <#cls>>( ) {
149
149
:: std:: result:: Result :: Ok ( cell) => cell,
150
- :: std:: result:: Result :: Err ( _) => return :: pyo3 :: callback:: convert( _py, _py. NotImplemented ( ) ) ,
150
+ :: std:: result:: Result :: Err ( _) => return _pyo3 :: callback:: convert( _py, _py. NotImplemented ( ) ) ,
151
151
}
152
152
}
153
153
}
@@ -471,17 +471,17 @@ impl<'a> FnSpec<'a> {
471
471
quote ! ( #func_name)
472
472
} ;
473
473
let rust_call =
474
- quote ! { :: pyo3 :: callback:: convert( #py, #rust_name( #self_arg #( #arg_names) , * ) ) } ;
474
+ quote ! { _pyo3 :: callback:: convert( #py, #rust_name( #self_arg #( #arg_names) , * ) ) } ;
475
475
Ok ( match self . convention {
476
476
CallingConvention :: Noargs => {
477
477
quote ! {
478
478
unsafe extern "C" fn #ident (
479
- _slf: * mut :: pyo3 :: ffi:: PyObject ,
480
- _args: * mut :: pyo3 :: ffi:: PyObject ,
481
- ) -> * mut :: pyo3 :: ffi:: PyObject
479
+ _slf: * mut _pyo3 :: ffi:: PyObject ,
480
+ _args: * mut _pyo3 :: ffi:: PyObject ,
481
+ ) -> * mut _pyo3 :: ffi:: PyObject
482
482
{
483
483
#deprecations
484
- :: pyo3 :: callback:: handle_panic( |#py| {
484
+ _pyo3 :: callback:: handle_panic( |#py| {
485
485
#self_conversion
486
486
#rust_call
487
487
} )
@@ -492,17 +492,17 @@ impl<'a> FnSpec<'a> {
492
492
let arg_convert_and_rust_call = impl_arg_params ( self , cls, rust_call, & py, true ) ?;
493
493
quote ! {
494
494
unsafe extern "C" fn #ident (
495
- _slf: * mut :: pyo3 :: ffi:: PyObject ,
496
- _args: * const * mut :: pyo3 :: ffi:: PyObject ,
497
- _nargs: :: pyo3 :: ffi:: Py_ssize_t ,
498
- _kwnames: * mut :: pyo3 :: ffi:: PyObject ) -> * mut :: pyo3 :: ffi:: PyObject
495
+ _slf: * mut _pyo3 :: ffi:: PyObject ,
496
+ _args: * const * mut _pyo3 :: ffi:: PyObject ,
497
+ _nargs: _pyo3 :: ffi:: Py_ssize_t ,
498
+ _kwnames: * mut _pyo3 :: ffi:: PyObject ) -> * mut _pyo3 :: ffi:: PyObject
499
499
{
500
500
#deprecations
501
- :: pyo3 :: callback:: handle_panic( |#py| {
501
+ _pyo3 :: callback:: handle_panic( |#py| {
502
502
#self_conversion
503
- let _kwnames: :: std:: option:: Option <& :: pyo3 :: types:: PyTuple > = #py. from_borrowed_ptr_or_opt( _kwnames) ;
503
+ let _kwnames: :: std:: option:: Option <& _pyo3 :: types:: PyTuple > = #py. from_borrowed_ptr_or_opt( _kwnames) ;
504
504
// Safety: &PyAny has the same memory layout as `*mut ffi::PyObject`
505
- let _args = _args as * const & :: pyo3 :: PyAny ;
505
+ let _args = _args as * const & _pyo3 :: PyAny ;
506
506
let _kwargs = if let :: std:: option:: Option :: Some ( kwnames) = _kwnames {
507
507
:: std:: slice:: from_raw_parts( _args. offset( _nargs) , kwnames. len( ) )
508
508
} else {
@@ -519,15 +519,15 @@ impl<'a> FnSpec<'a> {
519
519
let arg_convert_and_rust_call = impl_arg_params ( self , cls, rust_call, & py, false ) ?;
520
520
quote ! {
521
521
unsafe extern "C" fn #ident (
522
- _slf: * mut :: pyo3 :: ffi:: PyObject ,
523
- _args: * mut :: pyo3 :: ffi:: PyObject ,
524
- _kwargs: * mut :: pyo3 :: ffi:: PyObject ) -> * mut :: pyo3 :: ffi:: PyObject
522
+ _slf: * mut _pyo3 :: ffi:: PyObject ,
523
+ _args: * mut _pyo3 :: ffi:: PyObject ,
524
+ _kwargs: * mut _pyo3 :: ffi:: PyObject ) -> * mut _pyo3 :: ffi:: PyObject
525
525
{
526
526
#deprecations
527
- :: pyo3 :: callback:: handle_panic( |#py| {
527
+ _pyo3 :: callback:: handle_panic( |#py| {
528
528
#self_conversion
529
- let _args = #py. from_borrowed_ptr:: <:: pyo3 :: types:: PyTuple >( _args) ;
530
- let _kwargs: :: std:: option:: Option <& :: pyo3 :: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
529
+ let _args = #py. from_borrowed_ptr:: <_pyo3 :: types:: PyTuple >( _args) ;
530
+ let _kwargs: :: std:: option:: Option <& _pyo3 :: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
531
531
532
532
#arg_convert_and_rust_call
533
533
} )
@@ -539,20 +539,20 @@ impl<'a> FnSpec<'a> {
539
539
let arg_convert_and_rust_call = impl_arg_params ( self , cls, rust_call, & py, false ) ?;
540
540
quote ! {
541
541
unsafe extern "C" fn #ident (
542
- subtype: * mut :: pyo3 :: ffi:: PyTypeObject ,
543
- _args: * mut :: pyo3 :: ffi:: PyObject ,
544
- _kwargs: * mut :: pyo3 :: ffi:: PyObject ) -> * mut :: pyo3 :: ffi:: PyObject
542
+ subtype: * mut _pyo3 :: ffi:: PyTypeObject ,
543
+ _args: * mut _pyo3 :: ffi:: PyObject ,
544
+ _kwargs: * mut _pyo3 :: ffi:: PyObject ) -> * mut _pyo3 :: ffi:: PyObject
545
545
{
546
546
#deprecations
547
- use :: pyo3 :: callback:: IntoPyCallbackOutput ;
548
- :: pyo3 :: callback:: handle_panic( |#py| {
549
- let _args = #py. from_borrowed_ptr:: <:: pyo3 :: types:: PyTuple >( _args) ;
550
- let _kwargs: :: std:: option:: Option <& :: pyo3 :: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
547
+ use _pyo3 :: callback:: IntoPyCallbackOutput ;
548
+ _pyo3 :: callback:: handle_panic( |#py| {
549
+ let _args = #py. from_borrowed_ptr:: <_pyo3 :: types:: PyTuple >( _args) ;
550
+ let _kwargs: :: std:: option:: Option <& _pyo3 :: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
551
551
552
552
let result = #arg_convert_and_rust_call;
553
- let initializer: :: pyo3 :: PyClassInitializer :: <#cls> = result. convert( #py) ?;
553
+ let initializer: _pyo3 :: PyClassInitializer :: <#cls> = result. convert( #py) ?;
554
554
let cell = initializer. create_cell_from_subtype( #py, subtype) ?;
555
- :: std:: result:: Result :: Ok ( cell as * mut :: pyo3 :: ffi:: PyObject )
555
+ :: std:: result:: Result :: Ok ( cell as * mut _pyo3 :: ffi:: PyObject )
556
556
} )
557
557
}
558
558
}
@@ -567,23 +567,23 @@ impl<'a> FnSpec<'a> {
567
567
let doc = & self . doc ;
568
568
match self . convention {
569
569
CallingConvention :: Noargs => quote ! {
570
- :: pyo3 :: class:: methods:: PyMethodDef :: noargs(
570
+ _pyo3 :: class:: methods:: PyMethodDef :: noargs(
571
571
#python_name,
572
- :: pyo3 :: class:: methods:: PyCFunction ( #wrapper) ,
572
+ _pyo3 :: class:: methods:: PyCFunction ( #wrapper) ,
573
573
#doc,
574
574
)
575
575
} ,
576
576
CallingConvention :: Fastcall => quote ! {
577
- :: pyo3 :: class:: methods:: PyMethodDef :: fastcall_cfunction_with_keywords(
577
+ _pyo3 :: class:: methods:: PyMethodDef :: fastcall_cfunction_with_keywords(
578
578
#python_name,
579
- :: pyo3 :: class:: methods:: PyCFunctionFastWithKeywords ( #wrapper) ,
579
+ _pyo3 :: class:: methods:: PyCFunctionFastWithKeywords ( #wrapper) ,
580
580
#doc,
581
581
)
582
582
} ,
583
583
CallingConvention :: Varargs => quote ! {
584
- :: pyo3 :: class:: methods:: PyMethodDef :: cfunction_with_keywords(
584
+ _pyo3 :: class:: methods:: PyMethodDef :: cfunction_with_keywords(
585
585
#python_name,
586
- :: pyo3 :: class:: methods:: PyCFunctionWithKeywords ( #wrapper) ,
586
+ _pyo3 :: class:: methods:: PyCFunctionWithKeywords ( #wrapper) ,
587
587
#doc,
588
588
)
589
589
} ,
0 commit comments