Skip to content

Commit 21e2dfa

Browse files
committed
Fix type checking against struct time
1 parent 26ae1c7 commit 21e2dfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-bindings/time/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void struct_time_to_tm(mp_obj_t t, timeutils_struct_time_t *tm) {
166166
mp_obj_t *elems;
167167
size_t len;
168168

169-
if (!mp_obj_is_type(t, &mp_type_tuple) && !mp_obj_is_type(t, MP_OBJ_FROM_PTR(&struct_time_type_obj))) {
169+
if (!mp_obj_is_type(t, &mp_type_tuple) && !mp_obj_is_type(t, &struct_time_type_obj.base)) {
170170
mp_raise_TypeError(translate("Tuple or struct_time argument required"));
171171
}
172172

@@ -275,7 +275,7 @@ STATIC mp_obj_t time_mktime(mp_obj_t t) {
275275
mp_obj_t *elem;
276276
size_t len;
277277

278-
if (!mp_obj_is_type(t, &mp_type_tuple) && !mp_obj_is_type(t, MP_OBJ_FROM_PTR(&struct_time_type_obj))) {
278+
if (!mp_obj_is_type(t, &mp_type_tuple) && !mp_obj_is_type(t, &struct_time_type_obj.base)) {
279279
mp_raise_TypeError(translate("Tuple or struct_time argument required"));
280280
}
281281

0 commit comments

Comments
 (0)