From 26c61d43f414b2b2de3c97dbd8559d206c24fc9f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 13 Feb 2017 16:23:46 +0100 Subject: [PATCH] Change sys.implementation to return circuitpython and the circuitpython version number that doesn't start with v. Fixes #86. --- py/makeversionhdr.py | 7 +------ py/modsys.c | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index 69b9730eaf..e7cc4d6306 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 8c368ac35b..0a31967b53 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, } };