Skip to content

Commit 696fcde

Browse files
committed
cc3200/modusocket: Simplify socket.makefile() function.
Following how extmod/modlwip.c does it.
1 parent 3bedff0 commit 696fcde

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

cc3200/mods/modusocket.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -643,17 +643,8 @@ STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) {
643643
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking);
644644

645645
STATIC mp_obj_t socket_makefile(mp_uint_t n_args, const mp_obj_t *args) {
646-
// TODO: CPython explicitly says that closing the returned object doesn't
647-
// close the original socket (Python2 at all says that fd is dup()ed). But
648-
// we save on the bloat.
649-
mod_network_socket_obj_t *self = args[0];
650-
if (n_args > 1) {
651-
const char *mode = mp_obj_str_get_str(args[1]);
652-
if (strcmp(mode, "rb") && strcmp(mode, "wb")) {
653-
mp_raise_ValueError(mpexception_value_invalid_arguments);
654-
}
655-
}
656-
return self;
646+
(void)n_args;
647+
return args[0];
657648
}
658649
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 6, socket_makefile);
659650

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