Support loading plugins without sources

cx_Freeze include only the bytecodes version of the translation plugin.

Closes #13208
This commit is contained in:
Cédric Krier committed 2024-04-23 13:38:29 +02:00
1 parent f5db4a5899
commit 4c5659e87c
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):