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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy