Skip to content

Commit 26c61d4

Browse files
committed
Change sys.implementation to return circuitpython and the circuitpython version number that doesn't start with v. Fixes adafruit#86.
1 parent ae715a8 commit 26c61d4

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

py/makeversionhdr.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ def get_version_info_from_git():
4747
return None
4848

4949
# Try to extract MicroPython version from git tag
50-
if git_tag.startswith("v"):
51-
ver = git_tag[1:].split("-")[0].split(".")
52-
if len(ver) == 2:
53-
ver.append("0")
54-
else:
55-
ver = ["0", "0", "1"]
50+
ver = git_tag.split("-")[0].split(".")
5651

5752
return git_tag, git_hash, ver
5853

py/modsys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ STATIC MP_DEFINE_ATTRTUPLE(
6969
mp_sys_implementation_obj,
7070
impl_fields,
7171
2,
72-
MP_ROM_QSTR(MP_QSTR_micropython),
72+
MP_ROM_QSTR(MP_QSTR_circuitpython),
7373
MP_ROM_PTR(&mp_sys_implementation_version_info_obj)
7474
);
7575
#else
7676
STATIC const mp_obj_tuple_t mp_sys_implementation_obj = {
7777
{&mp_type_tuple},
7878
2,
7979
{
80-
MP_OBJ_NEW_QSTR(MP_QSTR_micropython),
80+
MP_OBJ_NEW_QSTR(MP_QSTR_circuitpython),
8181
(mp_obj_t)&mp_sys_implementation_version_info_obj,
8282
}
8383
};

0 commit comments

Comments
 (0)