We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b94b79a commit 81b0750Copy full SHA for 81b0750
packages/core/src/python/get-config.py
@@ -3,6 +3,7 @@
3
import importlib.util
4
import os
5
import platform
6
+from pathlib import Path
7
8
def sendMessage(text):
9
'sends a Node IPC message to parent proccess'
@@ -35,7 +36,10 @@ async def run_python_module(file_path: str) -> None:
35
36
raise ImportError(f"Could not load module from {file_path}")
37
38
module = importlib.util.module_from_spec(spec)
- module.__package__ = os.path.basename(module_dir)
39
+ flows_dir = Path(file_path).parents[1]
40
+ rel_parts = Path(file_path).relative_to(flows_dir).with_suffix("").parts
41
+ module_name = flows_dir.name + "." + ".".join(rel_parts)
42
+ module.__package__ = module_name.rsplit(".", 1)[0]
43
spec.loader.exec_module(module)
44
45
if not hasattr(module, 'config'):
0 commit comments