diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-13 16:23:46 +0100 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-13 16:23:46 +0100 |
| commit | 26c61d43f414b2b2de3c97dbd8559d206c24fc9f (patch) | |
| tree | 56a62fd293a98484052fb91892f00e5e9c2c6188 | |
| parent | ae715a827b3d9b0cdd700c514d487a1aa5905e1f (diff) | |
Change sys.implementation to return circuitpython and the circuitpython version number that doesn't start with v. Fixes #86.
| -rw-r--r-- | py/makeversionhdr.py | 7 | ||||
| -rw-r--r-- | py/modsys.c | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index 69b9730ea..e7cc4d630 100644 --- a/py/makeversionhdr.py +++ b/py/makeversionhdr.py @@ -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 diff --git a/py/modsys.c b/py/modsys.c index 8c368ac35..0a31967b5 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -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, } }; |
