Skip to content

Commit b255a15

Browse files
committed
fix more tests
1 parent 13b1a5e commit b255a15

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

py/mpprint.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {
597597
} else {
598598
base = 16;
599599
}
600+
// CIRCUITPY-CHANGE: include "0x" for 'p' and 'P'.
600601
if (fmt_chr == 'p' || fmt_chr == 'P') {
601602
#if SUPPORT_INT_BASE_PREFIX
602603
chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags | PF_FLAG_SHOW_PREFIX, fill, width);

py/objfun.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ static mp_obj_t fun_bc_make_new(const mp_obj_type_t *type, size_t n_args, size_t
184184
static void fun_bc_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
185185
(void)kind;
186186
mp_obj_fun_bc_t *o = MP_OBJ_TO_PTR(o_in);
187-
mp_printf(print, "<function %q at 0x%p>", mp_obj_fun_get_name(o_in), o);
187+
// CIRCUITPY-CHANGE: %p already prints "0x", so don't include it explicitly.
188+
mp_printf(print, "<function %q at %p>", mp_obj_fun_get_name(o_in), o);
188189
}
189190
#endif
190191

tests/extmod/binascii_unhexlify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# CIRCUITPY-CHANGE
1616
# Unicode strings can be decoded
17-
print(binascii.unhexlify("313233344142434461626364"))
17+
print(unhexlify("313233344142434461626364"))
1818

1919
try:
2020
a = unhexlify(b"0") # odd buffer length

tests/thread/disable_irq.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Ensure that disabling IRQs creates mutual exclusion between threads
22
# (also tests nesting of disable_irq across threads)
3-
import machine
4-
import time
5-
import _thread
3+
4+
# CIRCUITPY-CHANGE: no machine
5+
try:
6+
import machine
7+
import time
8+
import _thread
9+
except ImportError:
10+
print("SKIP")
11+
raise SystemExit
612

713
if not hasattr(machine, "disable_irq"):
814
print("SKIP")

0 commit comments

Comments
 (0)