Skip to content

Commit cebb10d

Browse files
committed
Fixes from review
1 parent b19c1a3 commit cebb10d

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

docs/library/errno.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
:mod:`uerrno` -- system error codes
1+
:mod:`errno` -- system error codes
22
===================================
33

4-
.. module:: uerrno
4+
.. module:: errno
55
:synopsis: system error codes
66

7-
|see_cpython_module| :mod:`python:errno`.
7+
|see_cpython_module| :mod:`cpython:errno`.
88

99
This module provides access to symbolic error codes for `OSError` exception.
1010
A particular inventory of codes depends on :term:`MicroPython port`.
@@ -20,15 +20,15 @@ Constants
2020
where ``exc`` is an instance of `OSError`. Usage example::
2121

2222
try:
23-
uos.mkdir("my_dir")
23+
os.mkdir("my_dir")
2424
except OSError as exc:
25-
if exc.args[0] == uerrno.EEXIST:
25+
if exc.args[0] == errno.EEXIST:
2626
print("Directory already exists")
2727

2828
.. data:: errorcode
2929

3030
Dictionary mapping numeric error codes to strings with symbolic error
3131
code (see above)::
3232

33-
>>> print(uerrno.errorcode[uerrno.EEXIST])
33+
>>> print(errno.errorcode[errno.EEXIST])
3434
EEXIST

py/argcheck.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ void mp_arg_check_num_sig(size_t n_args, size_t n_kw, uint32_t sig) {
5252
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
5353
mp_arg_error_terse_mismatch();
5454
#else
55-
mp_raise_msg_varg(&mp_type_TypeError,
56-
MP_ERROR_TEXT("function takes %d positional arguments but %d were given"),
55+
mp_raise_TypeError_varg(MP_ERROR_TEXT("function takes %d positional arguments but %d were given"),
5756
n_args_min, n_args);
5857
#endif
5958
}
@@ -62,15 +61,15 @@ void mp_arg_check_num_sig(size_t n_args, size_t n_kw, uint32_t sig) {
6261
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
6362
mp_arg_error_terse_mismatch();
6463
#else
65-
mp_raise_msg_varg(&mp_type_TypeError,
64+
mp_raise_TypeError_varg(
6665
MP_ERROR_TEXT("function missing %d required positional arguments"),
6766
n_args_min - n_args);
6867
#endif
6968
} else if (n_args > n_args_max) {
7069
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
7170
mp_arg_error_terse_mismatch();
7271
#else
73-
mp_raise_msg_varg(&mp_type_TypeError,
72+
mp_raise_TypeError_varg(
7473
MP_ERROR_TEXT("function expected at most %d arguments, got %d"),
7574
n_args_max, n_args);
7675
#endif
@@ -107,7 +106,7 @@ void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n
107106
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
108107
mp_arg_error_terse_mismatch();
109108
#else
110-
mp_raise_msg_varg(&mp_type_TypeError, MP_ERROR_TEXT("'%q' argument required"), allowed[i].qst);
109+
mp_raise_TypeError_varg(MP_ERROR_TEXT("'%q' argument required"), allowed[i].qst);
111110
#endif
112111
}
113112
out_vals[i] = allowed[i].defval;

py/objtuple.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
// type check is done on getiter method to allow tuple, namedtuple, attrtuple
3838
#define mp_obj_is_tuple_compatible(o) (mp_obj_get_type(o)->getiter == mp_obj_tuple_getiter)
3939

40-
// type check is done on getiter method to allow tuple, namedtuple, attrtuple
41-
#define mp_obj_is_tuple_compatible(o) (mp_obj_get_type(o)->getiter == mp_obj_tuple_getiter)
42-
4340
/******************************************************************************/
4441
/* tuple */
4542

tests/extmod/vfs_fat_finaliser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def ioctl(self, op, arg):
6262
f = vfs.open(n, "w")
6363
f.write(n)
6464
f = None # release f without closing
65-
[0, 1, 2, 3] # use up Python stack so f is really gone
65+
[0, 1, 2, 3, 4, 5] # use up Python stack so f is really gone
6666
gc.collect() # should finalise all N files by closing them
6767
for i in range(N):
6868
with vfs.open("x%d" % i, "r") as f:

0 commit comments

Comments
 (0)