Skip to content

Commit 1ccbe2f

Browse files
committed
Update Standard Library sys documentation
1 parent dfbbbad commit 1ccbe2f

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

docs/library/sys.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ Functions
1515
function raise as `SystemExit` exception. If an argument is given, its
1616
value given as an argument to `SystemExit`.
1717

18+
.. function:: print_exception(exc, file=sys.stdout, /)
19+
20+
Print exception with a traceback to a file-like object *file* (or
21+
`sys.stdout` by default).
22+
23+
.. admonition:: Difference to CPython
24+
:class: attention
25+
26+
This is simplified version of a function which appears in the
27+
``traceback`` module in CPython. Unlike ``traceback.print_exception()``,
28+
this function takes just exception value instead of exception type,
29+
exception value, and traceback object; *file* argument should be
30+
positional; further arguments are not supported. CPython-compatible
31+
``traceback`` module can be found in `micropython-lib`.
32+
1833
Constants
1934
---------
2035

@@ -97,12 +112,6 @@ Constants
97112
If you need to check whether your program runs on CircuitPython (vs other
98113
Python implementation), use `sys.implementation` instead.
99114

100-
.. data:: ps1
101-
ps2
102-
103-
Mutable attributes holding strings, which are used for the REPL prompt. The defaults
104-
give the standard Python prompt of ``>>>`` and ``...``.
105-
106115
.. data:: stderr
107116

108117
Standard error ``stream``.
@@ -115,14 +124,6 @@ Constants
115124

116125
Standard output ``stream``.
117126

118-
.. data:: tracebacklimit
119-
120-
A mutable attribute holding an integer value which is the maximum number of traceback
121-
entries to store in an exception. Set to 0 to disable adding tracebacks. Defaults
122-
to 1000.
123-
124-
Note: this is not available on all ports.
125-
126127
.. data:: version
127128

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

0 commit comments

Comments
 (0)