From 293dd23477eef6e7c1b1e26b5bb2c1e0d79ac3c2 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Tue, 19 Nov 2019 21:34:03 +0000 Subject: Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135 --- Lib/codeop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/codeop.py') diff --git a/Lib/codeop.py b/Lib/codeop.py index e5c7adea54..fc7e1e70ce 100644 --- a/Lib/codeop.py +++ b/Lib/codeop.py @@ -80,7 +80,7 @@ def _maybe_compile(compiler, source, filename, symbol): try: code = compiler(source, filename, symbol) - except SyntaxError as err: + except SyntaxError: pass try: -- cgit v1.2.1