mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user