From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#70653: [PATCH] Support source line location for Python ExceptionGroup Date: Tue, 30 Apr 2024 16:27:30 +0900 Message-ID: References: <86le4wqflz.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Tue_Apr_30_16:27:29_2024-1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14713"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 70653@debbugs.gnu.org To: ". shynur" , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 30 09:28:55 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1hv4-0003cx-VL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Apr 2024 09:28:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1hut-0007pq-LN; Tue, 30 Apr 2024 03:28:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1hus-0007ph-0o for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 03:28:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1hur-0002OS-Ox for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 03:28:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s1hvC-0002CG-5A for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 03:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2024 07:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70653 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70653-submit@debbugs.gnu.org id=B70653.17144620848432 (code B ref 70653); Tue, 30 Apr 2024 07:29:02 +0000 Original-Received: (at 70653) by debbugs.gnu.org; 30 Apr 2024 07:28:04 +0000 Original-Received: from localhost ([127.0.0.1]:59151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1huF-0002Bw-TD for submit@debbugs.gnu.org; Tue, 30 Apr 2024 03:28:04 -0400 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:51343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1huD-0002BS-Gs for 70653@debbugs.gnu.org; Tue, 30 Apr 2024 03:28:02 -0400 Original-Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6f4081574d6so1528443b3a.2 for <70653@debbugs.gnu.org>; Tue, 30 Apr 2024 00:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714462055; x=1715066855; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=FOwNY92vfK5vsf/XImxiw2Fs9pz0cB0QVnKTYgCze30=; b=gv0EQTWIfS5Tl1djLokUwaMrs+yQD3AkW/0BLQDW+Lfh5yBBggKwP8hCQV9hT48TZD ozSBtxZTI6xpU4ff7j2oehFoTwsPreYJx0KEZ0wVzapOPenBRXdykB8sgnw3E6E9EMVO LKemMNFfr3ql4/SoL4N6fWR5BdCWMMJqjD/xwnDIj3eQY2SFWhArfdrscqmkgjSMgjEO hEHRqFtvi6w0SZ23Jv5wxG56erNHwa6cKws4KzWZg9HBMC2GKnipYQwzsrm6woArYCv5 g5SixGSYiUDwgTumq4zkEIkppus+EqWG5Z3VnKX1aGHAkKrocrS3StWuL14UtuCcgr2O ZgNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714462055; x=1715066855; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FOwNY92vfK5vsf/XImxiw2Fs9pz0cB0QVnKTYgCze30=; b=NeAc6/1wni+5mqC20JI7cFcSSnONp5NxTq15MjenYAbYff4rNFtY3L1J1DspSCMaQ6 tqZUHLHiqaHznoP0QjSj5Ux79zi9u7g/W4hcVZKULUPlKgVARBU9jDXDkkZV+Zp9oMTv t+t8i8ksxctkrYt+wO1rXx/1VO63yP2trY+73hLthfCkTR7ssbQB9DdPdmXNkVr/YABc UE/y8ljFP1f1cmh7U5HwNsCbBAqaZ20VZpSdwnkmy98AwY+UQDOXQOd1HjBIVRLVR/tL fwYfKb9mIE37buJ7fCk70iNZ4NVXku0i++4ncSJYwZaJUhvUd9wo3U2dhSFWaKcdis3P 7Zfg== X-Gm-Message-State: AOJu0Ywt48RXTfA+Jg8H3L+/DAYUZPOggbTJQro7Er+MlI7Q6MVGuB7t Im1N7bMOkYh+kzEPzjIVFnfh1d9me9pUoGnYgiJaLqaOSqb08cV/2xDEcg== X-Google-Smtp-Source: AGHT+IEDJjZuxiySZqQpinvlJ/Xc0EvgG5TIjaMavMKpja/tYhj+uPkerhsaH8YJbK+JlM0qYOB7Xw== X-Received: by 2002:a05:6a21:3945:b0:1af:363d:64f5 with SMTP id ac5-20020a056a21394500b001af363d64f5mr10744876pzc.39.1714462055005; Tue, 30 Apr 2024 00:27:35 -0700 (PDT) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id r6-20020a17090a940600b002b2a7c89970sm446764pjo.35.2024.04.30.00.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 00:27:34 -0700 (PDT) In-Reply-To: <86le4wqflz.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284188 Archived-At: --Multipart_Tue_Apr_30_16:27:29_2024-1 Content-Type: text/plain; charset=US-ASCII Eli Zaretskii wrote: > > > From: ". shynur" > > Date: Mon, 29 Apr 2024 16:24:10 +0000 > > msip_labels: > > > > (This patch is written for Inferior Python mode.) > > > > The original behavior considered only the case of > > single exception: > > > > ``` > > Traceback (most recent call last): > > File "", line 17, in __PYTHON_EL_eval > > File "c:/Users/shynur/Desktop/Python/a.py", line 1, in > > raise Exception > > Exception > > ``` > > > > In the above example, one can click at the 3rd line to jump > > to the corresponding source line. This patch adds support > > for the following case (i.e., the built-in ExceptionGroup): > > > > ``` > > + Exception Group Traceback (most recent call last): > > | File "", line 17, in __PYTHON_EL_eval > > | File "c:/Users/shynur/Desktop/Python/a.py", line 1, in > > | raise ExceptionGroup("", [Exception()]) > > | ExceptionGroup: (1 sub-exception) > > +-+---------------- 1 ---------------- > > | Exception > > +------------------------------------ > > ``` > > Adding kobarity to the discussion. It looks good to me. Is it better to write NEWS since it is a change of the customize variable? Maybe we should also add ExceptionGroup as a Python keyword. The patch is attached. Should I open a new bug? --Multipart_Tue_Apr_30_16:27:29_2024-1 Content-Type: application/octet-stream; type=patch; name="0001-Add-ExceptionGroup-as-a-Python-keyword.patch" Content-Disposition: attachment; filename="0001-Add-ExceptionGroup-as-a-Python-keyword.patch" Content-Transfer-Encoding: 7bit >From 7af54b1e4c4ec9ff9eeebef52d9389f4064a7d20 Mon Sep 17 00:00:00 2001 From: kobarity Date: Tue, 30 Apr 2024 14:10:57 +0900 Subject: [PATCH] Add ExceptionGroup as a Python keyword * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): (python--treesit-exceptions): Add ExceptionGroup. --- lisp/progmodes/python.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 3f72295c808..eb913a4e68d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -785,6 +785,7 @@ python-font-lock-keywords-maximum-decoration "InterruptedError" "IsADirectoryError" "NotADirectoryError" "PermissionError" "ProcessLookupError" "RecursionError" "ResourceWarning" "StopAsyncIteration" "TimeoutError" + "ExceptionGroup" ;; OS specific "VMSError" "WindowsError" ) @@ -1052,6 +1053,7 @@ python--treesit-exceptions "InterruptedError" "IsADirectoryError" "NotADirectoryError" "PermissionError" "ProcessLookupError" "RecursionError" "ResourceWarning" "StopAsyncIteration" "TimeoutError" + "ExceptionGroup" ;; OS specific "VMSError" "WindowsError" )) -- 2.34.1 --Multipart_Tue_Apr_30_16:27:29_2024-1--