-
Notifications
You must be signed in to change notification settings - Fork 1.3k
4.1.x increase cpx stack update frozen #2407
New issue
Have a question about this project? Sign up for a free GitHub accou 8000 nt to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.1.x increase cpx stack update frozen #2407
Conversation
Update 4.x to 4.1.0 so that ReadTheDocs has the latest
Fix status DotStar writes: fixes DotStar issues on PyRulers
merge 4.1.x into 4.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully tested build on CPX with every available example in the Circuit Playground library repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again successfully with change. Thanks for putting this together!
This commit adds the errno attribute to exceptions, so code can retrieve errno codes from an OSError using exc.errno. The implementation here simply lets `errno` (and the existing `value`) attributes work on any exception instance (they both alias args[0]). This is for efficiency and to keep code size down. The pros and cons of this are: Pros: - more compatible with CPython, less difference to document and learn - OSError().errno will correctly return None, whereas the current way of doing it via OSError().args[0] will raise an IndexError - it reduces code size on most bare-metal ports (because they already have the errno qstr) - for Python code that uses exc.errno the generated bytecode is 2 bytes smaller and more efficient to execute (compared with exc.args[0]); so bytecode loaded to RAM saves 2 bytes RAM for each use of this attribute, and bytecode that is frozen saves 2 bytes flash/ROM for each use - it's easier/shorter to type, and saves 2 bytes of space in .py files that use it (for each use) Cons: - increases code size by 4-8 bytes on minimal ports that don't already have the `errno` qstr - all exceptions now have .errno and .value attributes (a cpydiff test is added to address this) See also adafruit#2407. Signed-off-by: Damien George <damien@micropython.org>
from adafruit_circuitplayground import cp
. Must be tested fromcode.py
, which adds additional stack depth over testing from REPL.