diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-07-28 13:29:47 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2018-07-28 13:29:47 -0400 |
| commit | f48b70050e3e4122eaae3eee47d35fc30bda2a4c (patch) | |
| tree | 7d2dacc3c137276e9d0838b571c84c09e78acc42 /extmod/moduhashlib.c | |
| parent | bc760dd34100099c352a0f185ec54ceae23d036d (diff) | |
merge finished
Diffstat (limited to 'extmod/moduhashlib.c')
| -rw-r--r-- | extmod/moduhashlib.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index 6389455c0..5e14fc8d4 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -29,14 +29,6 @@ #include "py/runtime.h" -static void check_not_unicode(const mp_obj_t arg) { -#if MICROPY_CPYTHON_COMPAT - if (MP_OBJ_IS_STR(arg)) { - mp_raise_TypeError("a bytes-like object is required"); - } -#endif -} - #if MICROPY_PY_UHASHLIB #if MICROPY_PY_UHASHLIB_SHA256 @@ -102,6 +94,14 @@ STATIC mp_obj_t uhashlib_sha256_digest(mp_obj_t self_in) { #else +static void check_not_unicode(const mp_obj_t arg) { +#if MICROPY_CPYTHON_COMPAT + if (MP_OBJ_IS_STR(arg)) { + mp_raise_TypeError("a bytes-like object is required"); + } +#endif +} + STATIC mp_obj_t uhashlib_sha256_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 0, 1, false); mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(CRYAL_SHA256_CTX)); |
