@@ -103,6 +103,18 @@ pub struct ExceptionZoo {
103
103
pub type_error : PyClassRef ,
104
104
pub value_error : PyClassRef ,
105
105
pub zero_division_error : PyClassRef ,
106
+
107
+ pub warning : PyClassRef ,
108
+ pub bytes_warning : PyClassRef ,
109
+ pub unicode_warning : PyClassRef ,
110
+ pub deprecation_warning : PyClassRef ,
111
+ pub pending_deprecation_warning : PyClassRef ,
112
+ pub future_warning : PyClassRef ,
113
+ pub import_warning : PyClassRef ,
114
+ pub syntax_warning : PyClassRef ,
115
+ pub resource_warning : PyClassRef ,
116
+ pub runtime_warning : PyClassRef ,
117
+ pub user_warning : PyClassRef ,
106
118
}
107
119
108
120
impl ExceptionZoo {
@@ -130,6 +142,19 @@ impl ExceptionZoo {
130
142
let file_not_found_error = create_type ( "FileNotFoundError" , & type_type, & os_error) ;
131
143
let permission_error = create_type ( "PermissionError" , & type_type, & os_error) ;
132
144
145
+ let warning = create_type ( "Warning" , & type_type, & exception_type) ;
146
+ let bytes_warning = create_type ( "BytesWarning" , & type_type, & warning) ;
147
+ let unicode_warning = create_type ( "UnicodeWarning" , & type_type, & warning) ;
148
+ let deprecation_warning = create_type ( "DeprecationWarning" , & type_type, & warning) ;
149
+ let pending_deprecation_warning =
150
+ create_type ( "PendingDeprecationWarning" , & type_type, & warning) ;
151
+ let future_warning = create_type ( "FutureWarning" , & type_type, & warning) ;
152
+ let import_warning = create_type ( "ImportWarning" , & type_type, & warning) ;
153
+ let syntax_warning = create_type ( "SyntaxWarning" , & type_type, & warning) ;
154
+ let resource_warning = create_type ( "ResourceWarning" , & type_type, & warning) ;
155
+ let runtime_warning = create_type ( "RuntimeWarning" , & type_type, & warning) ;
156
+ let user_warning = create_type ( "UserWarning" , & type_type, & warning) ;
157
+
133
158
ExceptionZoo {
134
159
arithmetic_error,
135
160
assertion_error,
@@ -152,6 +177,17 @@ impl ExceptionZoo {
152
177
type_error,
153
178
value_error,
154
179
zero_division_error,
180
+ warning,
181
+ bytes_warning,
182
+ unicode_warning,
183
+ deprecation_warning,
184
+ pending_deprecation_warning,
185
+ future_warning,
186
+ import_warning,
187
+ syntax_warning,
188
+ resource_warning,
189
+ runtime_warning,
190
+ user_warning,
155
191
}
156
192
}
157
193
}
0 commit comments