File tree 1 file changed +11
-7
lines changed 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -164,12 +164,6 @@ class modified_type_caster_generic_load_impl {
164
164
PYBIND11_NOINLINE bool load_impl (handle src, bool convert) {
165
165
if (!src) return false ;
166
166
if (!typeinfo) return try_load_foreign_module_local (src);
167
- if (src.is_none ()) {
168
- // Defer accepting None to other overloads (if we aren't in convert mode):
169
- if (!convert) return false ;
170
- loaded_v_h = value_and_holder ();
171
- return true ;
172
- }
173
167
174
168
auto &this_ = static_cast <ThisT &>(*this );
175
169
@@ -242,7 +236,17 @@ class modified_type_caster_generic_load_impl {
242
236
}
243
237
244
238
// Global typeinfo has precedence over foreign module_local
245
- return try_load_foreign_module_local (src);
239
+ if (try_load_foreign_module_local (src))
240
+ return true ;
241
+
242
+ if (src.is_none ()) {
243
+ // Defer accepting None to other overloads (if we aren't in convert mode):
244
+ if (!convert) return false ;
245
+ loaded_v_h = value_and_holder ();
246
+ return true ;
247
+ }
248
+
249
+ return false ;
246
250
}
247
251
248
252
const type_info *typeinfo = nullptr ;
You can’t perform that action at this time.
0 commit comments