File tree 1 file changed +19
-0
lines changed 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 33
33
34
34
#if MICROPY_HELPER_REPL
35
35
36
+ // CIRCUITPY-CHANGE: Disable warnings during autocomplete.
37
+ #if CIRCUITPY_WARNINGS
38
+ #include "shared-bindings/warnings/__init__.h"
39
+ #endif
40
+
36
41
#if MICROPY_PY_SYS_PS1_PS2
37
42
const char * mp_repl_get_psx (unsigned int entry ) {
38
43
if (mp_obj_is_str (MP_STATE_VM (sys_mutable )[entry ])) {
@@ -158,7 +163,21 @@ STATIC bool test_qstr(mp_obj_t obj, qstr name) {
158
163
if (obj ) {
159
164
// try object member
160
165
mp_obj_t dest [2 ];
166
+
167
+ // CIRCUITPY-CHANGE: Disable warnings during autocomplete. test_qstr()
168
+ // pretends to load every qstr from a module and it can trigger warnings
169
+ // meant to happen when user code imports them. So, save warning state and
170
+ // restore it once we've found matching completions.
171
+ #if CIRCUITPY_WARNINGS
172
+ warnings_action_t current_action = MP_STATE_THREAD (warnings_action );
<
73A5
/td>173
+ MP_STATE_THREAD (warnings_action ) = WARNINGS_IGNORE ;
174
+ #endif
175
+
161
176
mp_load_method_protected (obj , name , dest , true);
177
+
178
+ #if CIRCUITPY_WARNINGS
179
+ MP_STATE_THREAD (warnings_action ) = current_action ;
180
+ #endif
162
181
return dest [0 ] != MP_OBJ_NULL ;
163
182
} else {
164
183
// try builtin module
You can’t perform that action at this time.
0 commit comments