Change sys.implementation to return circuitpython and the circuitpython version number that doesn't start with v. Fixes #86.
This commit is contained in:
parent
ae715a827b
commit
26c61d43f4
@ -47,12 +47,7 @@ def get_version_info_from_git():
|
||||
return None
|
||||
|
||||
# Try to extract MicroPython version from git tag
|
||||
if git_tag.startswith("v"):
|
||||
ver = git_tag[1:].split("-")[0].split(".")
|
||||
if len(ver) == 2:
|
||||
ver.append("0")
|
||||
else:
|
||||
ver = ["0", "0", "1"]
|
||||
ver = git_tag.split("-")[0].split(".")
|
||||
|
||||
return git_tag, git_hash, ver
|
||||
|
||||
|
@ -69,7 +69,7 @@ STATIC MP_DEFINE_ATTRTUPLE(
|
||||
mp_sys_implementation_obj,
|
||||
impl_fields,
|
||||
2,
|
||||
MP_ROM_QSTR(MP_QSTR_micropython),
|
||||
MP_ROM_QSTR(MP_QSTR_circuitpython),
|
||||
MP_ROM_PTR(&mp_sys_implementation_version_info_obj)
|
||||
);
|
||||
#else
|
||||
@ -77,7 +77,7 @@ STATIC const mp_obj_tuple_t mp_sys_implementation_obj = {
|
||||
{&mp_type_tuple},
|
||||
2,
|
||||
{
|
||||
MP_OBJ_NEW_QSTR(MP_QSTR_micropython),
|
||||
MP_OBJ_NEW_QSTR(MP_QSTR_circuitpython),
|
||||
(mp_obj_t)&mp_sys_implementation_version_info_obj,
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user