summaryrefslogtreecommitdiffstatshomepage
path: root/py/stream.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-05-12 23:05:53 +0100
committerDamien George <damien.p.george@gmail.com>2015-05-12 23:05:53 +0100
commitc50772d19fe2804a6d0258f89dd9967d3b516fd3 (patch)
tree9db781cc50f27fd4d07f9ef1db9a862a29690d53 /py/stream.c
parentc2a4e4effc81d8ab21bb014e34355643e5ca0da2 (diff)
downloadmicropython-c50772d19fe2804a6d0258f89dd9967d3b516fd3.tar.gz
micropython-c50772d19fe2804a6d0258f89dd9967d3b516fd3.zip
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/stream.c')
-rw-r--r--py/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/stream.c b/py/stream.c
index 640659ec5a..258f916e08 100644
--- a/py/stream.c
+++ b/py/stream.c
@@ -225,7 +225,7 @@ STATIC mp_obj_t stream_readinto(mp_uint_t n_args, const mp_obj_t *args) {
// https://docs.python.org/3/library/socket.html#socket.socket.recv_into
mp_uint_t len = bufinfo.len;
if (n_args > 2) {
- len = mp_obj_int_get_truncated(args[2]);
+ len = mp_obj_get_int(args[2]);
if (len > bufinfo.len) {
len = bufinfo.len;
}