diff options
| author | DavePutz <dwputz@gmail.com> | 2020-05-11 21:50:01 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-11 21:50:01 -0500 |
| commit | 114f06d8250b4250a7c035f3bb1a2820ca2720d2 (patch) | |
| tree | aaf3d287d56cf32d42f359257ebfcd2e2d9bf90d /shared-bindings | |
| parent | 581c9cee0821f9586be4e4e30c31d5f569d8dede (diff) | |
| parent | 4712f9f1048612d92c0731dcee30fbd08a64263f (diff) | |
Merge pull request #3 from DavePutz/Issue2812
make translate done
Diffstat (limited to 'shared-bindings')
| -rw-r--r-- | shared-bindings/time/__init__.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 8d7f2f3fd..ef75a23bd 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -188,6 +188,14 @@ void struct_time_to_tm(mp_obj_t t, timeutils_struct_time_t *tm) { tm->tm_yday = mp_obj_get_int(elems[7]); // elems[8] tm_isdst is not supported } +#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE +// Function to return a NotImplementedError on platforms that don't +// support long integers +STATIC mp_obj_t time_not_implemented(void) { + mp_raise_NotImplementedError(translate("No long integer support")); +} +MP_DEFINE_CONST_FUN_OBJ_0(time_not_implemented_obj, time_not_implemented); +#endif #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE mp_obj_t MP_WEAK rtc_get_time_source_time(void) { @@ -307,6 +315,12 @@ STATIC const mp_rom_map_elem_t time_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_time_obj) }, { MP_ROM_QSTR(MP_QSTR_monotonic_ns), MP_ROM_PTR(&time_monotonic_ns_obj) }, #endif + #if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE + { MP_ROM_QSTR(MP_QSTR_localtime), MP_ROM_PTR(&time_not_implemented_obj) }, + { MP_ROM_QSTR(MP_QSTR_mktime), MP_ROM_PTR(&time_not_implemented_obj) }, + { MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_not_implemented_obj) }, + { MP_ROM_QSTR(MP_QSTR_monotonic_ns), MP_ROM_PTR(&time_not_implemented_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table); |
