File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -174,10 +174,12 @@ impl EnumValidateValue for PlainEnumValidator {
174
174
Ok ( None ) => {
175
175
if !strict {
176
176
if let Some ( py_input) = input. as_python ( ) {
177
+ // necessary for compatibility with 2.6, where str and int subclasses are allowed
177
178
if py_input. is_instance_of :: < PyString > ( ) {
178
179
return Ok ( lookup. validate_str ( input, false ) ?. map ( |v| v. clone_ref ( py) ) ) ;
179
180
} else if py_input. is_instance_of :: < PyInt > ( ) {
180
181
return Ok ( lookup. validate_int ( py, input, false ) ?. map ( |v| v. clone_ref ( py) ) ) ;
182
+ // necessary for compatibility with 2.6, where float values are allowed for int enums in lax mode
181
183
} else if py_input. is_instance_of :: < PyFloat > ( ) {
182
184
return Ok ( lookup. validate_int ( py, input, false ) ?. map ( |v| v. clone_ref ( py) ) ) ;
183
185
}
You can’t perform that action at this time.
0 commit comments