Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

For future reference, with Andrew's change merged above, the traceback for the 
example snippet in my message above:
https://bugs.python.org/issue45390#msg403570
is now the following. Observe that (1) the call to sleep() continues to be 
present, but (2) without introducing two new intermediate CancelledErrors, 
which increase the verbosity of the traceback:

Traceback (most recent call last):
  File "/home/andrew/projects/cpython/exc_traceback.py", line 14, in <module>
    asyncio.run(main())
    ^^^^^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/Lib/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/Lib/asyncio/base_events.py", line 640, in 
run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/exc_traceback.py", line 11, in main
    await task
    ^^^^^^^^^^
  File "/home/andrew/projects/cpython/exc_traceback.py", line 5, in job
    await asyncio.sleep(5)
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andrew/projects/cpython/Lib/asyncio/tasks.py", line 619, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: cancel job

(This is copied from Andrew's comment in the PR here:
https://github.com/python/cpython/pull/31383#issuecomment-1046822899 )

Serhiy, can you provide a sample snippet for your case with output, like I did 
in my message linked above?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45390>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to