PHP 8.2.30
Preview: formatter.py Size: 762 B
/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/tap/formatter.py

import traceback


def format_exception(exception):
    """Format an exception as diagnostics output.

    exception is the tuple as expected from sys.exc_info.
    """
    exception_lines = traceback.format_exception(*exception)
    # The lines returned from format_exception do not strictly contain
    # one line per element in the list (i.e. some elements have new
    # line characters in the middle). Normalize that oddity.
    lines = "".join(exception_lines).splitlines(True)
    return format_as_diagnostics(lines)


def format_as_diagnostics(lines):
    """Format the lines as diagnostics output by prepending the diagnostic #.

    This function makes no assumptions about the line endings.
    """
    return "".join(["# " + line for line in lines])

Directory Contents

Dirs: 2 × Files: 12

Name Size Perms Modified Actions
tests DIR
- drwxr-xr-x 2026-02-06 08:01:08
Edit Download
- drwxr-xr-x 2026-02-06 08:01:08
Edit Download
1.47 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
1.75 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
762 B lrw-r--r-- 2026-01-20 13:01:47
Edit Download
4.56 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
2.87 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
2.07 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
6.63 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
3.30 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
4.95 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
7.40 KB lrw-r--r-- 2026-01-20 13:01:47
Edit Download
85 B lrw-r--r-- 2026-01-20 13:01:47
Edit Download
48 B lrw-r--r-- 2026-01-20 13:01:47
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).