Skip to content

Unable to call async functions from a python file #25

Description

@osancus

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions