Fixed a few issues related to the use of pathlib.Path().glob(). eric7

Mon, 15 Aug 2022 14:08:34 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 15 Aug 2022 14:08:34 +0200
branch
eric7
changeset 9286
f6f950e4c8f0
parent 9285
d697b03e3bcc
child 9287
ce3ceb47300c

Fixed a few issues related to the use of pathlib.Path().glob().

src/eric7/WebBrowser/QtHelp/HelpDocsInstaller.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/Session/SessionManager.py file | annotate | diff | comparison | revisions
--- a/src/eric7/WebBrowser/QtHelp/HelpDocsInstaller.py	Wed Aug 10 19:32:28 2022 +0200
+++ b/src/eric7/WebBrowser/QtHelp/HelpDocsInstaller.py	Mon Aug 15 14:08:34 2022 +0200
@@ -199,7 +199,7 @@
             docsPath = pathlib.Path(
                 QLibraryInfo.path(QLibraryInfo.LibraryPath.DocumentationPath)
             )
-            if not docsPath.is_dir() or len(docsPath.glob("*.qch")) == 0:
+            if not docsPath.is_dir() or len(list(docsPath.glob("*.qch"))) == 0:
                 docsPath = (
                     docsPath.parents[2] / "Docs" / "Qt-{0}.{1}".format(*qVersionTuple())
                 )
@@ -207,7 +207,7 @@
             # unsupported Qt version
             return False
 
-        files = docsPath.glob("*.qch")
+        files = list(docsPath.glob("*.qch"))
         if not files:
             engine.setCustomValue(versionKey, "|")
             return False
@@ -271,7 +271,7 @@
 
         docsPath = pathlib.Path(getConfig("ericDocDir")) / "Help"
 
-        files = docsPath.glob("*.qch")
+        files = list(docsPath.glob("*.qch"))
         if not files:
             engine.setCustomValue(versionKey, "|")
             return False
--- a/src/eric7/WebBrowser/Session/SessionManager.py	Wed Aug 10 19:32:28 2022 +0200
+++ b/src/eric7/WebBrowser/Session/SessionManager.py	Mon Aug 15 14:08:34 2022 +0200
@@ -323,7 +323,7 @@
         if self.__sessionMetaData:
             return
 
-        sessionFiles = pathlib.Path(self.getSessionsDirectory()).glob("*.json")
+        sessionFiles = list(pathlib.Path(self.getSessionsDirectory()).glob("*.json"))
 
         for sessionFile in sessionFiles:
             sessionData = self.readSessionFromFile(sessionFile.resolve())

eric ide

mercurial