@@ -322,6 +322,7 @@ impl ExceptionCtor {
322322#[ derive( Debug , Clone ) ]
323323pub struct ExceptionZoo {
324324 pub base_exception_type : & ' static Py < PyType > ,
325+ pub base_exception_group : & ' static Py < PyType > ,
325326 pub system_exit : & ' static Py < PyType > ,
326327 pub keyboard_interrupt : & ' static Py < PyType > ,
327328 pub generator_exit : & ' static Py < PyType > ,
@@ -538,6 +539,7 @@ impl ExceptionZoo {
538539 let base_exception_type = PyBaseException :: init_bare_type ( ) ;
539540
540541 // Sorted By Hierarchy then alphabetized.
542+ let base_exception_group = PyBaseExceptionGroup :: init_bare_type ( ) ;
541543 let system_exit = PySystemExit :: init_bare_type ( ) ;
542544 let keyboard_interrupt = PyKeyboardInterrupt :: init_bare_type ( ) ;
543545 let generator_exit = PyGeneratorExit :: init_bare_type ( ) ;
@@ -623,6 +625,7 @@ impl ExceptionZoo {
623625
624626 Self {
625627 base_exception_type,
628+ base_exception_group,
626629 system_exit,
627630 keyboard_interrupt,
628631 generator_exit,
@@ -704,6 +707,10 @@ impl ExceptionZoo {
704707 PyBaseException :: extend_class ( ctx, excs. base_exception_type ) ;
705708
706709 // Sorted By Hierarchy then alphabetized.
710+ extend_exception ! ( PyBaseExceptionGroup , ctx, excs. base_exception_group, {
711+ "message" => ctx. new_readonly_getset( "message" , excs. base_exception_group, make_arg_getter( 0 ) ) ,
712+ "exceptions" => ctx. new_readonly_getset( "exceptions" , excs. base_exception_group, make_arg_getter( 1 ) ) ,
713+ } ) ;
707714 extend_exception ! ( PySystemExit , ctx, excs. system_exit, {
708715 "code" => ctx. new_readonly_getset( "code" , excs. system_exit, system_exit_code) ,
709716 } ) ;
@@ -1139,6 +1146,12 @@ pub(super) mod types {
11391146 system_exit,
11401147 "Request to exit from the interpreter."
11411148 }
1149+ define_exception ! {
1150+ PyBaseExceptionGroup ,
1151+ PyBaseException ,
1152+ base_exception_group,
1153+ "A combination of multiple unrelated exceptions."
1154+ }
11421155 define_exception ! {
11431156 PyGeneratorExit ,
11441157 PyBaseException ,
0 commit comments