8000 extmod/modwebsocket: Properly check number of args to constructor. · godlygeek/circuitpython@05ba243 · GitHub
[go: up one dir, main page]

Skip to content

Commit 05ba243

Browse files
committed
extmod/modwebsocket: Properly check number of args to constructor.
1 parent 5e919b7 commit 05ba243

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

extmod/modwebsocket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "py/nlr.h"
3333
#include "py/obj.h"
34+
#include "py/runtime.h"
3435
#include "py/stream.h"
3536

3637
#if MICROPY_PY_WEBSOCKET
@@ -50,7 +51,7 @@ typedef struct _mp_obj_websocket_t {
5051
} mp_obj_websocket_t;
5152

5253
STATIC mp_obj_t websocket_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
53-
assert(n_args == 1);
54+
mp_arg_check_num(n_args, n_kw, 1, 1, false);
5455
mp_obj_websocket_t *o = m_new_obj(mp_obj_websocket_t);
5556
o->base.type = type;
5657
o->sock = args[0];

0 commit comments

Comments
 (0)
0