Fixed an issue in the pip dependency display causing an exception if a package specifier i not known (i.e. is '?'). eric7

Sat, 04 Jun 2022 16:13:05 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 04 Jun 2022 16:13:05 +0200
branch
eric7
changeset 9120
5fb0ffe30569
parent 9119
5bcdef5207f6
child 9121
6ac528d4f318

Fixed an issue in the pip dependency display causing an exception if a package specifier i not known (i.e. is '?').

eric7/PipInterface/PipPackagesWidget.py file | annotate | diff | comparison | revisions
--- a/eric7/PipInterface/PipPackagesWidget.py	Sat Jun 04 15:53:41 2022 +0200
+++ b/eric7/PipInterface/PipPackagesWidget.py	Sat Jun 04 16:13:05 2022 +0200
@@ -1715,7 +1715,11 @@
         ])
         itm.setExpanded(True)
         
-        if dependency["required_version"].lower() != "any":
+        if dependency["installed_version"] == "?":
+            itm.setText(PipPackagesWidget.DepInstalledVersionColumn,
+                        self.tr("unknown"))
+        
+        if dependency["required_version"].lower() not in ("any", "?"):
             spec = (
                 "=={0}".format(dependency["required_version"])
                 if dependency["required_version"][0] in "0123456789" else
@@ -1726,10 +1730,14 @@
                 itm.setIcon(PipPackagesWidget.DepRequiredVersionColumn,
                             UI.PixmapCache.getIcon("warning"))
         
-        if dependency["required_version"].lower() == "any":
+        elif dependency["required_version"].lower() == "any":
             itm.setText(PipPackagesWidget.DepRequiredVersionColumn,
                         self.tr("any"))
         
+        elif dependency["required_version"] == "?":
+            itm.setText(PipPackagesWidget.DepRequiredVersionColumn,
+                        self.tr("unknown"))
+        
         # recursively add sub-dependencies
         for dep in dependency["dependencies"]:
             self.__addDependency(dep, itm)

eric ide

mercurial