py/{modbuiltins,repl}: Start qstr probing from after empty qstr.

The list of qstrs starts with MP_QSTR_NULL followed by MP_QSTR_, and these
should never appear in dir() or REPL tab completion, so skip them.
This commit is contained in:
Damien George
2018-05-09 16:15:02 +10:00
parent c1115d931f
commit eb88803ac8
2 changed files with 2 additions and 2 deletions

View File

@@ -186,7 +186,7 @@ STATIC mp_obj_t mp_builtin_dir(size_t n_args, const mp_obj_t *args) {
// Make a list of names in the given object
// Implemented by probing all possible qstrs with mp_load_method_maybe
size_t nqstr = QSTR_TOTAL();
for (size_t i = 1; i < nqstr; ++i) {
for (size_t i = MP_QSTR_ + 1; i < nqstr; ++i) {
mp_obj_t dest[2];
mp_load_method_maybe(args[0], i, dest);
if (dest[0] != MP_OBJ_NULL) {