Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions docs/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ Functions
function raise as `SystemExit` exception. If an argument is given, its
value given as an argument to `SystemExit`.

.. function:: print_exception(exc, file=sys.stdout, /)

Print exception with a traceback to a file-like object *file* (or
`sys.stdout` by default).

.. admonition:: Difference to CPython
:class: attention

This is simplified version of a function which appears in the
`traceback` module in CPython. Unlike `traceback.print_exception()`,
this function takes just exception value instead of exception type,
exception value, and traceback object; *file* argument should be
positional; further arguments are not supported.

Constants
---------

Expand Down Expand Up @@ -97,12 +111,6 @@ Constants
If you need to check whether your program runs on CircuitPython (vs other
Python implementation), use `sys.implementation` instead.

.. data:: ps1
ps2

Mutable attributes holding strings, which are used for the REPL prompt. The defaults
give the standard Python prompt of ``>>>`` and ``...``.

.. data:: stderr

Standard error ``stream``.
Expand All @@ -115,14 +123,6 @@ Constants

Standard output ``stream``.

.. data:: tracebacklimit

A mutable attribute holding an integer value which is the maximum number of traceback
entries to store in an exception. Set to 0 to disable adding tracebacks. Defaults
to 1000.

Note: this is not available on all ports.

.. data:: version

Python language version that this implementation conforms to, as a string.
Expand Down