3 ^c@sDddlZddlZddlmZddlmZddZddZd d ZdS) N) base_futures) coroutinescCsTtj|}|jrd|d<tj|j}|jdd||jdk rP|jdd|j|S)NZ cancellingrrz coro=<%s>iz wait_for=%r)rZ_future_repr_infoZ _must_cancelrZ_format_coroutine_coroZinsertZ _fut_waiter)taskZinfoZcoror*/usr/lib64/python3.6/asyncio/base_tasks.py_task_repr_infos   rc 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) rZcr_frameZAttributeErrorZgi_frameappendZf_backZreverse _exceptionZ __traceback__Ztb_frameZtb_next)rlimitZframesfZtbrrr_task_get_stacks0         r c 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)r zNo stack for %r)filez)Traceback for %r (most recent call last):z%Stack for %r (most recent call last):)rZend)ZsetZ get_stackZf_linenoZf_codeZ co_filenameZco_nameZadd linecacheZ checkcacheZgetlineZ f_globalsr r Zprint tracebackZ print_listZformat_exception_onlyZ __class__) rr rZextracted_listZcheckedr ZlinenoZcoZfilenameZnameZlineZexcrrr_task_print_stack3s0   r)rrrrrrr rrrrrZs