diff options
| author | Damien George <damien.p.george@gmail.com> | 2015-05-12 23:05:53 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2015-05-12 23:05:53 +0100 |
| commit | c50772d19fe2804a6d0258f89dd9967d3b516fd3 (patch) | |
| tree | 9db781cc50f27fd4d07f9ef1db9a862a29690d53 /py/objtype.c | |
| parent | c2a4e4effc81d8ab21bb014e34355643e5ca0da2 (diff) | |
py: Add mp_obj_get_int_truncated and use it where appropriate.
mp_obj_get_int_truncated will raise a TypeError if the argument is not
an integral type. Use mp_obj_int_get_truncated only when you know the
argument is a small or big int.
Diffstat (limited to 'py/objtype.c')
| -rw-r--r-- | py/objtype.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objtype.c b/py/objtype.c index 7b293c959..f593271fb 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -359,7 +359,7 @@ STATIC mp_obj_t instance_unary_op(mp_uint_t op, mp_obj_t self_in) { mp_obj_t val = mp_call_function_1(member[0], self_in); // __hash__ must return a small int if (op == MP_UNARY_OP_HASH) { - val = MP_OBJ_NEW_SMALL_INT(mp_obj_int_get_truncated(val)); + val = MP_OBJ_NEW_SMALL_INT(mp_obj_get_int_truncated(val)); } return val; } else { |
