MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / pexcept

Method pexcept

cmd2/cmd2.py:1686–1700  ·  view source on GitHub ↗

Print an exception to sys.stderr. If `debug` is true, a full traceback is also printed, if one exists. :param exception: the exception to be printed. :param kwargs: Arbitrary keyword arguments. This allows subclasses to extend the signature of this me

(
        self,
        exception: BaseException,
        **kwargs: Any,  # noqa: ARG002
    )

Source from the content-addressed store, hash-verified

1684 return capture.get()
1685
1686 def pexcept(
1687 self,
1688 exception: BaseException,
1689 **kwargs: Any, # noqa: ARG002
1690 ) -> None:
1691 """Print an exception to sys.stderr.
1692
1693 If `debug` is true, a full traceback is also printed, if one exists.
1694
1695 :param exception: the exception to be printed.
1696 :param kwargs: Arbitrary keyword arguments. This allows subclasses to extend the signature of this
1697 method and still call `super()` without encountering unexpected keyword argument errors.
1698 """
1699 formatted_exception = self.format_exception(exception)
1700 self.print_to(sys.stderr, formatted_exception)
1701
1702 def pfeedback(
1703 self,

Callers 5

onecmd_plus_hooksMethod · 0.95
test_pexcept_styleFunction · 0.80
test_pexcept_no_styleFunction · 0.80
page_fileMethod · 0.80
do_theme_showMethod · 0.80

Calls 2

format_exceptionMethod · 0.95
print_toMethod · 0.95

Tested by 2

test_pexcept_styleFunction · 0.64
test_pexcept_no_styleFunction · 0.64