Support loading plugins without sources

cx_Freeze include only the bytecodes version of the translation plugin.

Closes #13208
(grafted from c06fd05a195bfb9bae5dd388a366c0d58c2005a4)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2024-04-23 13:38:29 +02:00
1 parent 664978a7b9
commit bfb38de9c1
1 file changed
+5 -3
+5 -3
View File
@@ -24,9 +24,11 @@ def register():
imported = set()
for path in paths:
finder = importlib.machinery.FileFinder(
path, (
importlib.machinery.SourceFileLoader,
importlib.machinery.SOURCE_SUFFIXES))
path,
(importlib.machinery.SourceFileLoader,
importlib.machinery.SOURCE_SUFFIXES),
(importlib.machinery.SourcelessFileLoader,
importlib.machinery.BYTECODE_SUFFIXES))
for plugin in os.listdir(path):
module = os.path.splitext(plugin)[0]
if (module.startswith('_') or module in imported):