diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-01-19 19:45:35 -0500 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-01-19 19:45:35 -0500 |
| commit | 28cfd8a5135a1e420b56d693cef20fc1a4721081 (patch) | |
| tree | b6715f13a8312c1ae1e9c0ffd57c116c45dae108 /py/stream.c | |
| parent | 7a33e588d40e01862b60d6f0b9d2880ad19be030 (diff) | |
CharacteristicBuffer: make it be a stream class; add locking
Diffstat (limited to 'py/stream.c')
| -rw-r--r-- | py/stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/stream.c b/py/stream.c index aca9b8460..9d8be445c 100644 --- a/py/stream.c +++ b/py/stream.c @@ -103,7 +103,7 @@ STATIC mp_obj_t stream_read_generic(size_t n_args, const mp_obj_t *args, byte fl // CPython does a readall, but here we silently let negatives through, // and they will cause a MemoryError. mp_int_t sz; - if (n_args == 1 || ((sz = mp_obj_get_int(args[1])) == -1)) { + if (n_args == 1 || args[1] == mp_const_none || ((sz = mp_obj_get_int(args[1])) == -1)) { return stream_readall(args[0]); } |
