diff options
author | Damien George <damien@micropython.org> | 2025-03-02 23:52:13 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-03-05 12:23:40 +1100 |
commit | f5b4545761dbbce0c00dec6d90d180663a61eaa4 (patch) | |
tree | 9c1dcdb1c74fb05eaef5683ae1d72e9a05b3384d /tests/basics/sys1.py | |
parent | b4cf82b2d62c60c5e6e10d8d23c6b099b96c6f75 (diff) |
py/modsys: Add sys.implementation._build entry.
For a given MicroPython firmware/executable it can be sometimes important
to know how it was built, which variant/board configuration it came from.
This commit adds a new field `sys.implementation._build` that can help
identify the configuration that MicroPython was built with.
For now it's either:
* <VARIANT> for unix, webassembly and windows ports
* <BOARD>-<VARIANT> for microcontroller ports (the variant is optional)
In the future additional elements may be added to this string, separated by
a hyphen.
Resolves issue #16498.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/basics/sys1.py')
-rw-r--r-- | tests/basics/sys1.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/sys1.py b/tests/basics/sys1.py index 95d8905d1..94220fe4a 100644 --- a/tests/basics/sys1.py +++ b/tests/basics/sys1.py @@ -24,6 +24,12 @@ else: # Effectively skip subtests print(int) +if hasattr(sys.implementation, '_build'): + print(type(sys.implementation._build)) +else: + # Effectively skip subtests + print(str) + try: print(sys.intern('micropython') == 'micropython') has_intern = True |