@@ -387,6 +387,7 @@ pub struct ExceptionZoo {
387
387
pub unicode_warning : PyTypeRef ,
388
388
pub bytes_warning : PyTypeRef ,
389
389
pub resource_warning : PyTypeRef ,
390
+ pub encoding_warning : PyTypeRef ,
390
391
}
391
392
392
393
macro_rules! extend_exception {
@@ -603,6 +604,7 @@ impl ExceptionZoo {
603
604
let unicode_warning = PyUnicodeWarning :: init_bare_type ( ) . clone ( ) ;
604
605
let bytes_warning = PyBytesWarning :: init_bare_type ( ) . clone ( ) ;
605
606
let resource_warning = PyResourceWarning :: init_bare_type ( ) . clone ( ) ;
607
+ let encoding_warning = PyEncodingWarning :: init_bare_type ( ) . clone ( ) ;
606
608
607
609
Self {
608
610
base_exception_type,
@@ -673,6 +675,7 @@ impl ExceptionZoo {
673
675
unicode_warning,
674
676
bytes_warning,
675
677
resource_warning,
678
+ encoding_warning,
676
679
}
677
680
}
678
681
@@ -837,6 +840,7 @@ impl ExceptionZoo {
837
840
extend_exception ! ( PyUnicodeWarning , ctx, & excs. unicode_warning) ;
838
841
extend_exception ! ( PyBytesWarning , ctx, & excs. bytes_warning) ;
839
842
extend_exception ! ( PyResourceWarning , ctx, & excs. resource_warning) ;
843
+ extend_exception ! ( PyEncodingWarning , ctx, & excs. encoding_warning) ;
840
844
}
841
845
}
842
846
@@ -1524,4 +1528,10 @@ pub(super) mod types {
1524
1528
resource_warning,
1525
1529
"Base class for warnings about resource usage."
1526
1530
}
1531
+ define_exception ! {
1532
+ PyEncodingWarning ,
1533
+ PyWarning ,
1534
+ encoding_warning,
1535
+ "Base class for warnings about encodings."
1536
+ }
1527
1537
}
0 commit comments