Changes between Initial Version and Version 3 of Ticket #36872


Ignore:
Timestamp:
Jan 21, 2026, 6:49:48 AM (3 weeks ago)
Author:
Ricardo Robles
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36872 – Description

    initial v3  
    6565                # My proposal begins
    6666                if asyncio.iscoroutine(obj):
    67                     try:
    68                         loop = asyncio.get_event_loop()
    69                     except RuntimeError:
    70                         loop = asyncio.new_event_loop()
    71                         asyncio.set_event_loop(loop)
    72 
    73                     if loop.is_running():
    74                         obj = loop.run_until_complete(obj)
    75                     else:
    76                         obj = asyncio.run(obj)
     67                    obj = async_to_sync(lambda: obj)()
    7768                # My proposal ends
    7869
Back to Top