Tue, 15 Apr 2025 15:45:24 +0200
MicroPython Interface
- Reworked the recent change to cover more MPy variant strings..
src/eric7/MicroPython/Devices/DeviceBase.py | file | annotate | diff | comparison | revisions |
--- a/src/eric7/MicroPython/Devices/DeviceBase.py Tue Apr 15 12:23:11 2025 +0200 +++ b/src/eric7/MicroPython/Devices/DeviceBase.py Tue Apr 15 15:45:24 2025 +0200 @@ -1284,9 +1284,12 @@ try: import version res['mpy_variant_info'] = version.BUILD - try: - res['mpy_variant_version'] = version.BUILD.split('-')[2][1:] - except IndexError: + vbl = version.BUILD.split('-') + for v in vbl: + if v.startswith('v'): + res['mpy_variant_version'] = v[1:] + break + else: res['mpy_variant_version'] = '' except ImportError: res['mpy_variant_info'] = '' @@ -1410,9 +1413,12 @@ try: import version res['mpy_variant_info'] = version.BUILD - try: - res['mpy_variant_version'] = version.BUILD.split('-')[2][1:] - except IndexError: + vbl = version.BUILD.split('-') + for v in vbl: + if v.startswith('v'): + res['mpy_variant_version'] = v[1:] + break + else: res['mpy_variant_version'] = '' except ImportError: res['mpy_variant_info'] = ''