Skip to content

Commit 72d70cb

Browse files
committed
unix, stmhal: Consistently use "FileIO" as class name for file objects.
They correspond to io.FileIO in io module hierarchy (with small caveat that io.FileIO is raw file and works with bytes, not strings).
1 parent b8cf948 commit 72d70cb

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

stmhal/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ typedef struct _pyb_file_obj_t {
1515
} pyb_file_obj_t;
1616

1717
void file_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
18-
printf("<file %p>", self_in);
18+
printf("<io.FileIO %p>", self_in);
1919
}
2020

2121
STATIC machine_int_t file_read(mp_obj_t self_in, void *buf, machine_uint_t size, int *errcode) {
@@ -69,7 +69,7 @@ STATIC const mp_stream_p_t file_obj_stream_p = {
6969

7070
STATIC const mp_obj_type_t file_obj_type = {
7171
{ &mp_type_type },
72-
.name = MP_QSTR_File,
72+
.name = MP_QSTR_FileIO,
7373
.make_new = file_obj_make_new,
7474
.print = file_obj_print,
7575
.getiter = mp_identity,

stmhal/qstrdefsport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Q(SDcard)
3333
Q(gpio)
3434
Q(gpio_in)
3535
Q(gpio_out)
36-
Q(File)
36+
Q(FileIO)
3737
// Entries for sys.path
3838
Q(0:/)
3939
Q(0:/src)

unix/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ STATIC const mp_stream_p_t rawfile_stream_p = {
130130

131131
STATIC const mp_obj_type_t rawfile_type = {
132132
{ &mp_type_type },
133-
.name = MP_QSTR_io_dot_FileIO,
133+
.name = MP_QSTR_FileIO,
134134
.print = fdfile_print,
135135
.make_new = fdfile_make_new,
136136
.getiter = mp_identity,

unix/qstrdefsport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Q(accept)
2727
Q(recv)
2828
Q(setsockopt)
2929

30-
Q(io.FileIO)
30+
Q(FileIO)
3131
Q(ffimod)
3232
Q(ffifunc)
3333
Q(fficallback)

0 commit comments

Comments
 (0)