Commit 4b711aa6 authored by lintangsutawika's avatar lintangsutawika
Browse files

normalize path

parent d3d1b7f1
...@@ -395,8 +395,10 @@ def import_function(loader, node): ...@@ -395,8 +395,10 @@ def import_function(loader, node):
function_name = loader.construct_scalar(node) function_name = loader.construct_scalar(node)
yaml_path = os.path.dirname(loader.name) yaml_path = os.path.dirname(loader.name)
module_name, function_name = function_name.split(".") *module_name, function_name = function_name.split(".")
module_path = os.path.join(yaml_path, "{}.py".format(module_name)) if type(module_name) == list:
module_name = ".".join(module_name)
module_path = os.path.normpath(os.path.join(yaml_path, "{}.py".format(module_name)))
spec = importlib.util.spec_from_file_location(module_name, module_path) spec = importlib.util.spec_from_file_location(module_name, module_path)
module = importlib.util.module_from_spec(spec) module = importlib.util.module_from_spec(spec)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment