Fixed a 'semver' compatibility issue in the CircuitPython updater and the MIP package dialog. eric7

Tue, 19 Mar 2024 16:36:16 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 19 Mar 2024 16:36:16 +0100
branch
eric7
changeset 10643
08682797bfcd
parent 10642
fbf61874518a
child 10644
e56175bfead8

Fixed a 'semver' compatibility issue in the CircuitPython updater and the MIP package dialog.

src/eric7/MicroPython/Devices/CircuitPythonUpdater/ShowOutdatedDialog.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/MipPackageDialog.py file | annotate | diff | comparison | revisions
--- a/src/eric7/MicroPython/Devices/CircuitPythonUpdater/ShowOutdatedDialog.py	Fri Mar 15 08:13:04 2024 +0100
+++ b/src/eric7/MicroPython/Devices/CircuitPythonUpdater/ShowOutdatedDialog.py	Tue Mar 19 16:36:16 2024 +0100
@@ -62,8 +62,12 @@
                     " updating.\nMPY Format changes require an update."
                 )
             )
+            try:
+                versionIsValid = VersionInfo.is_valid
+            except AttributeError:
+                versionIsValid = VersionInfo.isvalid
             for module in self.__modules.values():
-                if isinstance(module.bundle_version, str) and not VersionInfo.isvalid(
+                if isinstance(module.bundle_version, str) and not versionIsValid(
                     module.bundle_version
                 ):
                     reason = self.tr("Incorrect '__version__' Metadata")
--- a/src/eric7/MicroPython/MipPackageDialog.py	Fri Mar 15 08:13:04 2024 +0100
+++ b/src/eric7/MicroPython/MipPackageDialog.py	Tue Mar 19 16:36:16 2024 +0100
@@ -53,7 +53,10 @@
         enable = bool(self.packageEdit.text())
         version = self.versionEdit.text()
         if version:
-            enable &= VersionInfo.isvalid(version)
+            try:
+                enable &= VersionInfo.is_valid(version)
+            except AttributeError:
+                enable &= VersionInfo.isvalid(version)
 
         self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
 

eric ide

mercurial