Skip to content

Commit 508b064

Browse files
committed
Fix tests and update translations
1 parent fa68428 commit 508b064

File tree

6 files changed

+82
-55
lines changed

6 files changed

+82
-55
lines changed

extmod/modasyncio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ STATIC const mp_rom_map_elem_t task_queue_locals_dict_table[] = {
145145
{ MP_ROM_QSTR(MP_QSTR_push), MP_ROM_PTR(&task_queue_push_obj) },
146146
{ MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&task_queue_pop_obj) },
147147
{ MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&task_queue_remove_obj) },
148+
149+
// CIRCUITPY-CHANGE: Remove these in CircuitPython 10.0.0
150+
{ MP_ROM_QSTR(MP_QSTR_push_head), MP_ROM_PTR(&task_queue_push_obj) },
151+
{ MP_ROM_QSTR(MP_QSTR_push_sorted), MP_ROM_PTR(&task_queue_push_obj) },
152+
{ MP_ROM_QSTR(MP_QSTR_pop_head), MP_ROM_PTR(&task_queue_pop_obj) },
148153
};
149154
STATIC MP_DEFINE_CONST_DICT(task_queue_locals_dict, task_queue_locals_dict_table);
150155

extmod/modjson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ STATIC mp_obj_t mod_json_loads(mp_obj_t obj) {
437437
mp_get_buffer_raise(obj, &bufinfo, MP_BUFFER_READ);
438438
vstr_t vstr = {bufinfo.len, bufinfo.len, (char *)bufinfo.buf, true};
439439
mp_obj_stringio_t sio = {{&mp_type_stringio}, &vstr, 0, MP_OBJ_NULL};
440-
return mod_json_load(MP_OBJ_FROM_PTR(&sio));
440+
return _mod_json_load(MP_OBJ_FROM_PTR(&sio), false);
441441
}
442442
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_json_loads_obj, mod_json_loads);
443443

locale/circuitpython.pot

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,7 @@ msgid "'await' outside function"
395395
msgstr ""
396396

397397
#: py/compile.c
398-
msgid "'await', 'async for' or 'async with' outside async function"
399-
msgstr ""
400-
401-
#: py/compile.c
402-
msgid "'break' outside loop"
403-
msgstr ""
404-
405-
#: py/compile.c
406-
msgid "'continue' outside loop"
398+
msgid "'break'/'continue' outside loop"
407399
msgstr ""
408400

409401
#: py/compile.c
@@ -422,10 +414,6 @@ msgstr ""
422414
msgid "'return' outside function"
423415
msgstr ""
424416

425-
#: py/compile.c
426-
msgid "'yield from' inside async function"
427-
msgstr ""
428-
429417
#: py/compile.c
430418
msgid "'yield' outside function"
431419
msgstr ""
@@ -965,7 +953,7 @@ msgstr ""
965953
msgid "EXTINT channel already in use"
966954
msgstr ""
967955

968-
#: extmod/modure.c
956+
#: extmod/modre.c
969957
msgid "Error in regex"
970958
msgstr ""
971959

@@ -1045,7 +1033,7 @@ msgstr ""
10451033
msgid "Failed to write internal flash."
10461034
msgstr ""
10471035

1048-
#: py/moduerrno.c
1036+
#: py/moderrno.c
10491037
msgid "File exists"
10501038
msgstr ""
10511039

@@ -1180,7 +1168,7 @@ msgstr ""
11801168
msgid "Input taking too long"
11811169
msgstr ""
11821170

1183-
#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c
1171+
#: ports/espressif/common-hal/neopixel_write/__init__.c py/moderrno.c
11841172
msgid "Input/output error"
11851173
msgstr ""
11861174

@@ -1259,7 +1247,7 @@ msgstr ""
12591247
msgid "Invalid MAC address"
12601248
msgstr ""
12611249

1262-
#: ports/espressif/common-hal/espidf/__init__.c py/moduerrno.c
1250+
#: ports/espressif/common-hal/espidf/__init__.c py/moderrno.c
12631251
msgid "Invalid argument"
12641252
msgstr ""
12651253

@@ -1525,15 +1513,15 @@ msgstr ""
15251513
msgid "No pulldown on pin; 1Mohm recommended"
15261514
msgstr ""
15271515

1528-
#: py/moduerrno.c
1516+
#: py/moderrno.c
15291517
msgid "No space left on device"
15301518
msgstr ""
15311519

1532-
#: py/moduerrno.c
1520+
#: py/moderrno.c
15331521
msgid "No such device"
15341522
msgstr ""
15351523

1536-
#: py/moduerrno.c
1524+
#: py/moderrno.c
15371525
msgid "No such file/directory"
15381526
msgstr ""
15391527

@@ -1654,7 +1642,7 @@ msgstr ""
16541642
msgid "Only one color can be transparent at a time"
16551643
msgstr ""
16561644

1657-
#: py/moduerrno.c
1645+
#: py/moderrno.c
16581646
msgid "Operation not permitted"
16591647
msgstr ""
16601648

@@ -1708,7 +1696,7 @@ msgstr ""
17081696
msgid "Peripheral in use"
17091697
msgstr ""
17101698

1711-
#: py/moduerrno.c
1699+
#: py/moderrno.c
17121700
msgid "Permission denied"
17131701
msgstr ""
17141702

@@ -1842,7 +1830,7 @@ msgstr ""
18421830
msgid "Read-only"
18431831
msgstr ""
18441832

1845-
#: extmod/vfs_fat.c py/moduerrno.c
1833+
#: extmod/vfs_fat.c py/moderrno.c
18461834
msgid "Read-only filesystem"
18471835
msgstr ""
18481836

@@ -2403,7 +2391,7 @@ msgstr ""
24032391
msgid "__new__ arg must be a user-type"
24042392
msgstr ""
24052393

2406-
#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c
2394+
#: extmod/modbinascii.c extmod/modhashlib.c py/objarray.c
24072395
msgid "a bytes-like object is required"
24082396
msgstr ""
24092397

@@ -2477,6 +2465,10 @@ msgstr ""
24772465
msgid "asm overflow"
24782466
msgstr ""
24792467

2468+
#: py/compile.c
2469+
msgid "async for/with outside async function"
2470+
msgstr ""
2471+
24802472
#: extmod/ulab/code/numpy/numerical.c
24812473
msgid "attempt to get (arg)min/(arg)max of empty sequence"
24822474
msgstr ""
@@ -2529,7 +2521,7 @@ msgstr ""
25292521
msgid "bitmap sizes must match"
25302522
msgstr ""
25312523

2532-
#: extmod/modurandom.c
2524+
#: extmod/modrandom.c
25332525
msgid "bits must be 32 or less"
25342526
msgstr ""
25352527

@@ -2610,11 +2602,11 @@ msgstr ""
26102602
msgid "can't assign to expression"
26112603
msgstr ""
26122604

2613-
#: extmod/moduasyncio.c
2605+
#: extmod/modasyncio.c
26142606
msgid "can't cancel self"
26152607
msgstr ""
26162608

2617-
#: py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c
2609+
#: shared-module/adafruit_pixelbuf/PixelBuf.c
26182610
msgid "can't convert %q to %q"
26192611
msgstr ""
26202612

@@ -2628,6 +2620,11 @@ msgstr ""
26282620
msgid "can't convert %s to float"
26292621
msgstr ""
26302622

2623+
#: py/runtime.c
2624+
#, c-format
2625+
msgid "can't convert %s to int"
2626+
msgstr ""
2627+
26312628
#: py/objstr.c
26322629
msgid "can't convert '%q' object to %q implicitly"
26332630
msgstr ""
@@ -2738,7 +2735,7 @@ msgstr ""
27382735
msgid "can't unambiguously get sizeof scalar"
27392736
msgstr ""
27402737

2741-
#: extmod/moduasyncio.c
2738+
#: extmod/modasyncio.c
27422739
msgid "can't wait"
27432740
msgstr ""
27442741

@@ -2830,7 +2827,7 @@ msgstr ""
28302827
msgid "complex values not supported"
28312828
msgstr ""
28322829

2833-
#: extmod/moduzlib.c
2830+
#: extmod/modzlib.c
28342831
msgid "compression header"
28352832
msgstr ""
28362833

@@ -2944,7 +2941,7 @@ msgstr ""
29442941
msgid "empty file"
29452942
msgstr ""
29462943

2947-
#: extmod/moduasyncio.c extmod/moduheapq.c
2944+
#: extmod/modasyncio.c extmod/modheapq.c
29482945
msgid "empty heap"
29492946
msgstr ""
29502947

@@ -3073,6 +3070,10 @@ msgstr ""
30733070
msgid "font must be 2048 bytes long"
30743071
msgstr ""
30753072

3073+
#: extmod/moddeflate.c
3074+
msgid "format"
3075+
msgstr ""
3076+
30763077
#: py/objstr.c
30773078
msgid "format requires a dict"
30783079
msgstr ""
@@ -3149,11 +3150,11 @@ msgstr ""
31493150
msgid "graphic must be 2048 bytes long"
31503151
msgstr ""
31513152

3152-
#: extmod/moduhashlib.c
3153+
#: extmod/modhashlib.c
31533154
msgid "hash is final"
31543155
msgstr ""
31553156

3156-
#: extmod/moduheapq.c
3157+
#: extmod/modheapq.c
31573158
msgid "heap must be a list"
31583159
msgstr ""
31593160

@@ -3185,7 +3186,7 @@ msgstr ""
31853186
msgid "incomplete format key"
31863187
msgstr ""
31873188

3188-
#: extmod/modubinascii.c
3189+
#: extmod/modbinascii.c
31893190
msgid "incorrect padding"
31903191
msgstr ""
31913192

@@ -3314,7 +3315,7 @@ msgid "interval must be in range %s-%s"
33143315
msgstr ""
33153316

33163317
#: py/compile.c
3317-
msgid "invalid architecture"
3318+
msgid "invalid arch"
33183319
msgstr ""
33193320

33203321
#: shared-bindings/bitmaptools/__init__.c
@@ -3503,6 +3504,10 @@ msgstr ""
35033504
msgid "memoryview: length is not a multiple of itemsize"
35043505
msgstr ""
35053506

3507+
#: extmod/modtime.c
3508+
msgid "mktime needs a tuple of length 8 or 9"
3509+
msgstr ""
3510+
35063511
#: extmod/ulab/code/numpy/linalg/linalg.c
35073512
msgid "mode must be complete, or reduced"
35083513
msgstr ""
@@ -3600,7 +3605,7 @@ msgstr ""
36003605
msgid "no default packer"
36013606
msgstr ""
36023607

3603-
#: extmod/modurandom.c
3608+
#: extmod/modrandom.c
36043609
msgid "no default seed"
36053610
msgstr ""
36063611

@@ -4027,7 +4032,7 @@ msgstr ""
40274032
msgid "source_bitmap must have value_count of 8"
40284033
msgstr ""
40294034

4030-
#: extmod/modure.c
4035+
#: extmod/modre.c
40314036
msgid "splitting with sub-captures"
40324037
msgstr ""
40334038

@@ -4076,15 +4081,15 @@ msgstr ""
40764081
msgid "super() can't find self"
40774082
msgstr ""
40784083

4079-
#: extmod/modujson.c
4084+
#: extmod/modjson.c
40804085
msgid "syntax error in JSON"
40814086
msgstr ""
40824087

40834088
#: extmod/moductypes.c
40844089
msgid "syntax error in uctypes descriptor"
40854090
msgstr ""
40864091

4087-
#: extmod/utime_mphal.c
4092+
#: extmod/modtime.c
40884093
msgid "ticks interval overflow"
40894094
msgstr ""
40904095

@@ -4262,7 +4267,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d"
42624267
msgstr ""
42634268

42644269
#: py/runtime.c
4265-
msgid "unsupported type for %q: '%q'"
4270+
msgid "unsupported type for %q: '%s'"
42664271
msgstr ""
42674272

42684273
#: py/runtime.c
@@ -4290,6 +4295,10 @@ msgstr ""
42904295
msgid "value out of range of target"
42914296
msgstr ""
42924297

4298+
#: extmod/moddeflate.c
4299+
msgid "wbits"
4300+
msgstr ""
4301+
42934302
#: shared-bindings/is31fl3741/FrameBuffer.c
42944303
msgid "width must be greater than zero"
42954304
msgstr ""

tests/extmod/asyncio_micropython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ async def main():
4040
print("finish")
4141

4242

43-
uasyncio.run(main())
43+
asyncio.run(main())

tests/run-tests.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,13 +715,18 @@ def run_one_test(test_file):
715715
output_expected = f.read()
716716
else:
717717
# CIRCUITPY-CHANGE: set language & make sure testlib is available for `skip_ok`.
718-
e = {"PYTHONPATH": "testlib", "PATH": os.environ["PATH"], "LANG": "en_US.UTF-8"}
718+
e = {
719+
"PYTHONPATH": base_path("testlib"),
720+
"PATH": os.environ["PATH"],
721+
"LANG": "en_US.UTF-8",
722+
}
719723
# run CPython to work out expected output
720724
try:
721725
output_expected = subprocess.check_output(
722726
CPYTHON3_CMD + [os.path.abspath(test_file)],
723727
cwd=os.path.dirname(test_file),
724728
stderr=subprocess.STDOUT,
729+
env=e,
725730
)
726731
if args.write_exp:
727732
with open(test_file_expected, "wb") as f:
@@ -1022,8 +1027,16 @@ def main():
10221027
tests = args.files
10231028

10241029
if not args.keep_path:
1025-
# clear search path to make sure tests use only builtin modules and those in extmod
1026-
os.environ["MICROPYPATH"] = ".frozen" + os.pathsep + base_path("../extmod")
1030+
# clear search path to make sure tests use only builtin modules and those that can be frozen
1031+
# CIRCUITPY-CHANGE: Add testlib for skip_if and our async stuff.
1032+
os.environ["MICROPYPATH"] = os.pathsep.join(
1033+
[
1034+
".frozen",
1035+
base_path("testlib"),
1036+
base_path("../frozen/Adafruit_CircuitPython_asyncio"),
1037+
base_path("../frozen/Adafruit_CircuitPython_Ticks"),
1038+
]
1039+
)
10271040

10281041
try:
10291042
os.makedirs(args.result_dir, exist_ok=True)

0 commit comments

Comments
 (0)