The Python shell recognizes the line containing a file path and
a line number when an exception is raised up to the top-level,
in order to locate the source of error. It's supposed to
recognize the built-in ExceptionGroup as well. (Bug#70653)
* lisp/progmodes/python.el (python-shell-compilation-regexp-alist):
Take the single leading vertical line into account.
* etc/NEWS: Announce this change.
(cherry picked from commit
bfb31a06acadd5e819a3cb8dc6886122e53646f3)
It sends the python block delimited by 'python-nav-beginning-of-block'
and 'python-nav-end-of-block' to the inferior Python process.
+** Inferior Python mode
+
+---
+*** Default value of 'python-shell-compilation-regexp-alist' is changed.
+Support for Python's ExceptionGroup has been added, so in the Python
+shell, the line indicating the source of error in the error messages
+from ExceptionGroup will be recognized as well.
+
** Scheme mode
Scheme mode now handles regular expression literal '#/regexp/' that is
available in some Scheme implementations.
:type '(repeat symbol))
(defcustom python-shell-compilation-regexp-alist
- `((,(rx line-start (1+ (any " \t")) "File \""
+ `((,(rx line-start (1+ (any " \t")) (? ?| (1+ (any " \t"))) "File \""
(group (1+ (not (any "\"<")))) ; avoid `<stdin>' &c
"\", line " (group (1+ digit)))
1 2)