8000 Merge pull request #1497 from jerryneedell/jerryn_fix_time · marcnewlin/circuitpython@cd0aacc · GitHub
[go: up one dir, main page]

Skip to content

Commit cd0aacc

Browse files
authored
Merge pull request adafruit#1497 from jerryneedell/jerryn_fix_time
fix kw_arg checking for time.struct_time()
2 parents 6be4b07 + 44bd9d1 commit cd0aacc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-bindings/time/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);
8484

8585
#if MICROPY_PY_COLLECTIONS
8686
mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
87-
if (n_args != 1 || kw_args != NULL || kw_args->used > 0) {
87+
if (n_args != 1 || (kw_args != NULL && kw_args->used > 0)) {
8888
mp_raise_TypeError(translate("time.struct_time() takes exactly 1 argument"));
8989
}
9090
if (!MP_OBJ_IS_TYPE(args[0], &mp_type_tuple) || ((mp_obj_tuple_t*) MP_OBJ_TO_PTR(args[0]))->len != 9) {

0 commit comments

Comments
 (0)
0