File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -402,9 +402,25 @@ The following exceptions are the exceptions that are usually raised.
402
402
or :func: `eval `, or when reading the initial script or standard input
403
403
(also interactively).
404
404
405
- Instances of this class have attributes :attr: `filename `, :attr: `lineno `,
406
- :attr: `offset ` and :attr: `text ` for easier access to the details. :func: `str `
407
- of the exception instance returns only the message.
405
+ The :func: `str ` of the exception instance returns only the error message.
406
+
407
+ .. attribute :: filename
408
+
409
+ The name of the file the syntax error occurred in.
410
+
411
+ .. attribute :: lineno
412
+
413
+ Which line number in the file the error occurred in. This is
414
+ 1-indexed: the first line in the file has a ``lineno `` of 1.
415
+
416
+ .. attribute :: offset
417
+
418
+ The column in the line where the error occurred. This is
419
+ 1-indexed: the first character in the line has an ``offset `` of 1.
420
+
421
+ .. attribute :: text
422
+
423
+ The source code text involved in the error.
408
424
409
425
410
426
.. exception :: IndentationError
You can’t perform that action at this time.
0 commit comments