curio/task.py
def _format_stack(task, complete=False):
    '''
    Formats a traceback from a stack of coroutines/generators
    '''
    dirname = os.path.dirname(__file__)
    extracted_list = []
    checked = set()
    for f in _get_stack(task.coro):
        lineno = f.f_lineno
        co = f.f_code
        filename = co.co_filename
        name = co.co_name
        if not complete and os.path.dirname(filename) == dirname:
            continue
        if filename not in checked:
            checked.add(filename)
            linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        extracted_list.append((filename, lineno, name, line))
    if not extracted_list:
        resp = f'No stack for {task!r}'
    else:
        resp = f'Stack for {task!r} (most recent call last):\n'
        resp += ''.join(traceback.format_list(extracted_list))
    return resp

    Formats a traceback from a stack of coroutines/generators
    
Formats a traceback from a stack of coroutines/generators
Formats a traceback from a stack of coroutines / generators
def _format_stack(task, complete=False):
    dirname = os.path.dirname(__file__)
    extracted_list = []
    checked = set()
    for f in _get_stack(task.coro):
        lineno = f.f_lineno
        co = f.f_code
        filename = co.co_filename
        name = co.co_name
        if not complete and os.path.dirname(filename) == dirname:
            continue
        if filename not in checked:
            checked.add(filename)
            linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        extracted_list.append((filename, lineno, name, line))
    if not extracted_list:
        resp = f'No stack for {task!r}'
    else:
        resp = f'Stack for {task!r} (most recent call last):\n'
        resp += ''.join(traceback.format_list(extracted_list))
    return resp
def _format_stack ( task , complete = False ) : dirname = os . path . dirname ( __file__ ) extracted_list = [ ] checked = set ( ) for f in _get_stack ( task . coro ) : lineno = f . f_lineno co = f . f_code filename = co . co_filename name = co . co_name if not complete and os . path . dirname ( filename ) == dirname : continue if filename not in checked : checked . add ( filename ) linecache . checkcache ( filename ) line = linecache . getline ( filename , lineno , f . f_globals ) extracted_list . append ( ( filename , lineno , name , line ) ) if not extracted_list : resp = f'No stack for {task!r}' else : resp = f'Stack for {task!r} (most recent call last):\n' resp += '' . join ( traceback . format_list ( extracted_list ) ) return resp
Formats a traceback from a stack of coroutines/generators
Formats a traceback from a stack of coroutines / generators
'''
    Formats a traceback from a stack of coroutines/generators
    '''
task
complete