PyNode icon indicating copy to clipboard operation
PyNode copied to clipboard

Unable to call async functions from a python file

Open osancus opened this issue 5 years ago • 1 comments

Unable to call 'sub' function

async def sub(a, b):
  return a - b

Error: sys:1: RuntimeWarning: coroutine 'sub' was never awaited RuntimeWarning: Enable tracemalloc to get the object allocation traceback err : Unsupported type returned (coroutine), only pure Python types are supported.

Unable to call 'execute' function

def execute(a, b):
  loop = asyncio.get_event_loop()
  answer = loop.run_until_complete(sub(a,b))
  print(answer)
  loop.close()

Error: Segmentation fault: 11

osancus avatar May 07 '20 12:05 osancus

Not sure if this may help - https://stackoverflow.com/a/62383036

beeing avatar Jul 12 '21 00:07 beeing