@@ -15,6 +15,21 @@ Functions
15
15
function raise as `SystemExit ` exception. If an argument is given, its
16
16
value given as an argument to `SystemExit `.
17
17
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
+
18
33
Constants
19
34
---------
20
35
@@ -97,12 +112,6 @@ Constants
97
112
If you need to check whether your program runs on CircuitPython (vs other
98
113
Python implementation), use `sys.implementation ` instead.
99
114
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
-
106
115
.. data :: stderr
107
116
108
117
Standard error ``stream ``.
@@ -115,14 +124,6 @@ Constants
115
124
116
125
Standard output ``stream ``.
117
126
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
-
126
127
.. data :: version
127
128
128
129
Python language version that this implementation conforms to, as a string.
0 commit comments