Commit Graph

19 Commits

Author SHA1 Message Date
Jeff Epler
b83c42e41a
Implement the chain= argument of traceback.print_exception 2022-12-02 10:50:31 -06:00
Jeff Epler
febc7a8514
format_traceback: Return list, as documented, and compatible with CPython 2022-10-13 09:38:43 -05:00
Jeff Epler
448eb1b70b
Document the 3.10-style calling pattern 2022-10-13 09:38:42 -05:00
Jeff Epler
47759294e0
code changes for supporting 1-arg print_exception 2022-10-13 09:38:42 -05:00
Jeff Epler
fc991c262c
traceback: share more code between format & print exception 2022-10-13 09:38:42 -05:00
Jeff Epler
907c5d387f
Tweak black_bindings
Originally, black_bindings found each contiguous "//|" block and sent
it to black independently. This was slower than it needed to be.

Instead, swap the comment prefix: when running black, take off
"//|" prefixes and put "##|" prefixes on all un-prefixed lines.
Then, after black is run, do the opposite operation

This more than doubles the overall speed of "pre-commit run --all",
from 3m20s to 55s CPU time on my local machine (32.5s to under 10s
"elapsed" time)

It also causes a small amount of churn in the bindings, because
black now sees enough context to know whether one 'def' follows another
or ends the 'def's in a 'class'. In the latter case, it adds an extra
newline, which becomes a "//|" line.

I'm less sure why a trailing comma was omitted before down in
rp2pio/StateMachine.c but let's roll with it.
2022-09-30 11:18:13 -05:00
Jeff Epler
b2cc8d2aad
run black_bindings across all bindings 2022-09-27 15:21:42 -05:00
Alec Delaney
bbc29e84a7
Add os, "socket", atexit, ssl, struct, traceback, math links 2022-05-03 12:31:20 -06:00
microDev
70b3e73349
traceback: fix for crash on non-native exceptions
Co-authored-by: Tim Hawes <me@timhawes.com>
2021-12-15 12:29:21 +05:30
microDev
69faaa52b8
run test for traceback module 2021-12-02 14:55:02 +05:30
microDev
1977011cfd
use mp_arg_validate_type for keyword args 2021-10-10 15:28:35 +05:30
Dan Halbert
1acafbf675 Fix n_args_min on many MP_DEFINE_CONST_FUN_OBJ_KW() 2021-10-07 16:55:19 -04:00
Rob Capellini
1c8828223f Convert more modules to use MP_REGISTER_MODULE
Convert neopixel_write, onewireio, ps2io, pulseio, pwmio, rainbowio, random, rgbmatrix, rotaryio, rtc, sdcardio, sharpdisplay, _stage, storage, struct, supervisor, synthio, touchio, traceback, usb_cdc, usb_hid, usb_midi, and vectorio modules to use MP_REGISTER_MODULE.

Related to #5183.
2021-08-30 22:29:51 -04:00
Scott Shawcroft
7e55905d95
Fix up onewireio docs and other notes
Not all of the notes were marked correctly.
2021-08-12 11:15:04 -07:00
microDev
32ee06b293
fix crash when traceback object is supplied 2021-08-09 22:53:23 +05:30
Jeff Epler
9a932a5a48 traceback: Implement format_exception 2021-08-09 08:27:28 -05:00
microDev
870f26bfc4
traceback module refinements 2021-08-05 20:11:15 +05:30
microDev
fb0f2583db
update traceback module 2021-08-04 12:22:21 +05:30
microDev
f371c0a609
add traceback module 2021-07-28 18:06:23 +05:30