3 ^@sDddlZddlZddlmZddlmZddZddZd d ZdS) N) base_futures) coroutinescCsTtj|}|jrd|d<tj|j}|jdd||jdk rP|jdd|j|S)NZ cancellingrrz coro=<%s>z wait_for=%r)rZ_future_repr_infoZ _must_cancelrZ_format_coroutine_coroinsertZ _fut_waiter)taskinfocoror */usr/lib64/python3.6/asyncio/base_tasks.py_task_repr_infos   r c Csg}y |jj}Wntk r,|jj}YnX|dk rxx6|dk rl|dk rZ|dkrRP|d8}|j||j}q8W|jnL|jdk r|jj}x8|dk r|dk r|dkrP|d8}|j|j |j }qW|S)Nrr) rcr_frameAttributeErrorgi_frameappendf_backreverse _exception __traceback__tb_frametb_next)rlimitZframesftbr r r _task_get_stacks0         rc Csg}t}xj|j|dD]Z}|j}|j}|j}|j} ||krP|j|tj|tj |||j } |j ||| | fqW|j } |st d||dn*| dk rt d||dnt d||dtj||d| dk rx$tj| j| D]} t | |ddqWdS)N)rzNo stack for %r)filez)Traceback for %r (most recent call last):z%Stack for %r (most recent call last):)rend)setZ get_stackf_linenof_code co_filenameco_nameadd linecache checkcachegetline f_globalsrrprint traceback print_listformat_exception_only __class__) rrrextracted_listZcheckedrlinenocofilenamenamelineexcr r r _task_print_stack3s0   r5)r%r*rrrr rr5r r r r s