Changed some import statements for 'importlib' to 'importlib.util' because sometimes the first doesn't work properly (reason unknown but somewhere in the interpreter). eric7

Fri, 12 Jan 2024 12:08:29 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 12 Jan 2024 12:08:29 +0100
branch
eric7
changeset 10496
f9925e08dbce
parent 10495
73ec0786d60e
child 10497
0d7f1c8cd219

Changed some import statements for 'importlib' to 'importlib.util' because sometimes the first doesn't work properly (reason unknown but somewhere in the interpreter).

scripts/install.py file | annotate | diff | comparison | revisions
scripts/uninstall.py file | annotate | diff | comparison | revisions
src/eric7/DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
src/eric7/PluginManager/PluginManager.py file | annotate | diff | comparison | revisions
src/eric7/PluginManager/PluginUninstallDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginVcsPySvn.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py file | annotate | diff | comparison | revisions
src/eric7/Preferences/ConfigurationPages/EditorFilePage.py file | annotate | diff | comparison | revisions
src/eric7/QScintilla/Exporters/ExporterHTML.py file | annotate | diff | comparison | revisions
src/eric7/SystemUtilities/PySideImporter.py file | annotate | diff | comparison | revisions
src/eric7/SystemUtilities/QtUtilities.py file | annotate | diff | comparison | revisions
src/eric7/Testing/Interfaces/PytestRunner.py file | annotate | diff | comparison | revisions
src/eric7/Tools/webBrowserSupport.py file | annotate | diff | comparison | revisions
src/eric7/UI/Previewers/PreviewerHTML.py file | annotate | diff | comparison | revisions
src/eric7/Utilities/ClassBrowsers/__init__.py file | annotate | diff | comparison | revisions
src/eric7/Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/scripts/install.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/scripts/install.py	Fri Jan 12 12:08:29 2024 +0100
@@ -17,6 +17,7 @@
 import getpass
 import glob
 import importlib
+import importlib.util
 import io
 import json
 import os
--- a/scripts/uninstall.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/scripts/uninstall.py	Fri Jan 12 12:08:29 2024 +0100
@@ -13,7 +13,7 @@
 import argparse
 import contextlib
 import glob
-import importlib
+import importlib.util
 import os
 import shutil
 import sys
--- a/src/eric7/DebugClients/Python/DebugClientBase.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/DebugClients/Python/DebugClientBase.py	Fri Jan 12 12:08:29 2024 +0100
@@ -12,7 +12,7 @@
 import codeop
 import contextlib
 import fnmatch
-import importlib
+import importlib.util
 import json
 import os
 import re
--- a/src/eric7/PluginManager/PluginManager.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/PluginManager/PluginManager.py	Fri Jan 12 12:08:29 2024 +0100
@@ -10,6 +10,7 @@
 import contextlib
 import datetime
 import importlib
+import importlib.util
 import itertools
 import os
 import pathlib
--- a/src/eric7/PluginManager/PluginUninstallDialog.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/PluginManager/PluginUninstallDialog.py	Fri Jan 12 12:08:29 2024 +0100
@@ -8,7 +8,7 @@
 """
 
 import glob
-import importlib
+import importlib.util
 import os
 import shutil
 import sys
--- a/src/eric7/Plugins/PluginVcsPySvn.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Plugins/PluginVcsPySvn.py	Fri Jan 12 12:08:29 2024 +0100
@@ -8,7 +8,7 @@
 """
 
 import contextlib
-import importlib
+import importlib.util
 import os
 
 from PyQt6.QtCore import QCoreApplication, QObject
--- a/src/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py	Fri Jan 12 12:08:29 2024 +0100
@@ -7,7 +7,7 @@
 Module implementing the PyQt6 server part of the QRegularExpression wizzard.
 """
 
-import importlib
+import importlib.util
 import json
 import sys
 
--- a/src/eric7/Preferences/ConfigurationPages/EditorFilePage.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Preferences/ConfigurationPages/EditorFilePage.py	Fri Jan 12 12:08:29 2024 +0100
@@ -7,7 +7,7 @@
 Module implementing the Editor File Handling configuration page.
 """
 
-import importlib
+import importlib.util
 
 from PyQt6.Qsci import QsciScintilla
 from PyQt6.QtCore import pyqtSlot
--- a/src/eric7/QScintilla/Exporters/ExporterHTML.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/QScintilla/Exporters/ExporterHTML.py	Fri Jan 12 12:08:29 2024 +0100
@@ -10,7 +10,7 @@
 # This code is a port of the C++ code found in SciTE 1.74
 # Original code: Copyright 1998-2006 by Neil Hodgson <neilh@scintilla.org>
 
-import importlib
+import importlib.util
 import io
 import os
 import sys
--- a/src/eric7/SystemUtilities/PySideImporter.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/SystemUtilities/PySideImporter.py	Fri Jan 12 12:08:29 2024 +0100
@@ -17,15 +17,15 @@
 
     if pySideVariant == "1":
         # no PySide support anymore
-        ret = 1
+        ret = 10
 
     elif pySideVariant == "2":
-        ret = 1 if importlib.util.find_spec("PySide") is None else 0
+        ret = 10 if importlib.util.find_spec("PySide") is None else 0
 
     elif pySideVariant == "6":
-        ret = 1 if importlib.util.find_spec("PySide6") is None else 0
+        ret = 10 if importlib.util.find_spec("PySide6") is None else 0
 
     else:
-        ret = 1
+        ret = 10
 
     sys.exit(ret)
--- a/src/eric7/SystemUtilities/QtUtilities.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/SystemUtilities/QtUtilities.py	Fri Jan 12 12:08:29 2024 +0100
@@ -8,7 +8,6 @@
 """
 
 import contextlib
-import functools
 import os
 import sys
 import sysconfig
@@ -379,7 +378,6 @@
         return toolname
 
 
-@functools.lru_cache()
 def checkPyside(variant=2):
     """
     Module function to check the presence of PySide2/PySide6.
--- a/src/eric7/Testing/Interfaces/PytestRunner.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Testing/Interfaces/PytestRunner.py	Fri Jan 12 12:08:29 2024 +0100
@@ -8,7 +8,7 @@
 """
 
 import contextlib
-import importlib
+import importlib.util
 import json
 import os
 import sys
--- a/src/eric7/Tools/webBrowserSupport.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Tools/webBrowserSupport.py	Fri Jan 12 12:08:29 2024 +0100
@@ -11,7 +11,7 @@
 it is absent.
 """
 
-import importlib
+import importlib.util
 import sys
 
 variant = (
--- a/src/eric7/UI/Previewers/PreviewerHTML.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/UI/Previewers/PreviewerHTML.py	Fri Jan 12 12:08:29 2024 +0100
@@ -7,7 +7,7 @@
 Module implementing a previewer widget for HTML, Markdown and ReST files.
 """
 
-import importlib
+import importlib.util
 import io
 import os
 import re
--- a/src/eric7/Utilities/ClassBrowsers/__init__.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Utilities/ClassBrowsers/__init__.py	Fri Jan 12 12:08:29 2024 +0100
@@ -19,6 +19,7 @@
 """
 
 import importlib
+import importlib.machinery
 import os
 
 from eric7 import Preferences
--- a/src/eric7/Utilities/__init__.py	Thu Jan 11 22:13:39 2024 +0100
+++ b/src/eric7/Utilities/__init__.py	Fri Jan 12 12:08:29 2024 +0100
@@ -10,7 +10,7 @@
 import codecs
 import contextlib
 import glob
-import importlib
+import importlib.util
 import json
 import os
 import re

eric ide

mercurial