@@ -231,7 +231,7 @@ macro_rules! create_exception_type_object {
231231 }
232232 }
233233
234- $crate:: create_exception_introspection_data!( $module , $ name, $base) ;
234+ $crate:: create_exception_introspection_data!( $name, $base) ;
235235 } ;
236236}
237237
@@ -240,42 +240,15 @@ macro_rules! create_exception_type_object {
240240#[ doc( hidden) ]
241241#[ macro_export]
242242macro_rules! create_exception_introspection_data(
243- ( $module : expr , $ name: ident, $base: ty) => { } ;
243+ ( $name: ident, $base: ty) => { } ;
244244) ;
245245
246- #[ cfg( feature = "experimental-inspect" ) ]
246+ #[ cfg( all ( feature = "experimental-inspect" , feature = "macros" ) ) ]
247247#[ doc( hidden) ]
248248#[ macro_export]
249249macro_rules! create_exception_introspection_data(
250- ( $module: expr, $name: ident, $base: ty) => {
251- const _: ( ) = {
252- const PIECES : & [ & [ u8 ] ] = & [
253- b"{\" type\" :\" class\" ,\" id\" :\" " ,
254- $name:: _PYO3_INTROSPECTION_ID. as_bytes( ) ,
255- b"\" ,\" name\" :\" " ,
256- stringify!( $name) . as_bytes( ) ,
257- b"\" ,\" bases\" :[" ,
258- {
259- const BASE_LEN : usize = $crate:: inspect:: serialized_len_for_introspection( & <$base as $crate:: type_object:: PyTypeInfo >:: TYPE_HINT ) ;
260- const BASE_SER : [ u8 ; BASE_LEN ] = {
261- let mut result: [ u8 ; BASE_LEN ] = [ 0 ; BASE_LEN ] ;
262- $crate:: inspect:: serialize_for_introspection( & <$base as $crate:: type_object:: PyTypeInfo >:: TYPE_HINT , & mut result) ;
263- result
264- } ;
265- & BASE_SER
266- } ,
267- b"]}"
268- ] ;
269- const PIECES_LEN : usize = $crate:: impl_:: concat:: combined_len( PIECES ) ;
270- $crate:: impl_:: introspection:: paste! {
271- #[ used]
272- #[ no_mangle]
273- static [ <PYO3_INTROSPECTION_1_ $name>] : $crate:: impl_:: introspection:: SerializedIntrospectionFragment <PIECES_LEN > = $crate:: impl_:: introspection:: SerializedIntrospectionFragment {
274- length: PIECES_LEN as u32 ,
275- fragment: $crate:: impl_:: concat:: combine_to_array:: <PIECES_LEN >( PIECES )
276- } ;
277- }
278- } ;
250+ ( $name: ident, $base: ty) => {
251+ $crate:: implement_class_introspection!( $crate, $name, $base) ;
279252 } ;
280253) ;
281254
0 commit comments