Commit 9dd7f39a authored by payno's avatar payno
Browse files

[PythonActor] add workaround in python actor to take script.py

parent 6267921c
...@@ -189,8 +189,10 @@ class PythonActor(AbstractActor): ...@@ -189,8 +189,10 @@ class PythonActor(AbstractActor):
# Import script # Import script
self.script = script self.script = script
if script is not None: if script is not None:
module = importlib.import_module(os.path.splitext(script)[0]) # module = importlib.import_module(os.path.splitext(script)[0])
node = Node('.'.join((module.__name__, 'run'))) if script.endswith('.py'):
script = ''.join(os.path.splitext(script)[:-1])
node = Node('.'.join((script, 'run')))
self.actor_wrapper = ActorWrapper(node=node) self.actor_wrapper = ActorWrapper(node=node)
else: else:
self.actor_wrapper = ActorWrapper(node=node) self.actor_wrapper = ActorWrapper(node=node)
......
Supports Markdown
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