Skip to content

Commit 3865456

Browse files
authored
Merge pull request #9427 from RetiredWizard/sysdoc
Update Standard Library sys documentation
2 parents 2d518a2 + 01fb9de commit 3865456

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

docs/library/sys.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ 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+
This function is being deprecated and will be removed starting in
21+
CircuitPython 10.x, `traceback.print_exception()` should be used instead.
22+
23+
Print exception with a traceback to a file-like object *file* (or
24+
`sys.stdout` by default).
25+
26+
.. admonition:: Difference to CPython
27+
:class: attention
28+
29+
This is simplified version of a function which appears in the
30+
`traceback` module in CPython. Unlike `traceback.print_exception()`,
31+
this function takes just exception value instead of exception type,
32+
exception value, and traceback object; *file* argument should be
33+
positional; further arguments are not supported.
34+
1835
Constants
1936
---------
2037

@@ -97,12 +114,6 @@ Constants
97114
If you need to check whether your program runs on CircuitPython (vs other
98115
Python implementation), use `sys.implementation` instead.
99116

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-
106117
.. data:: stderr
107118

108119
Standard error ``stream``.
@@ -115,14 +126,6 @@ Constants
115126

116127
Standard output ``stream``.
117128

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-
126129
.. data:: version
127130

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

0 commit comments

Comments
 (0)