summaryrefslogtreecommitdiff
path: root/Lib/importlib
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-11-19 21:34:03 +0000
committerGitHub <noreply@github.com>2019-11-19 21:34:03 +0000
commit293dd23477eef6e7c1b1e26b5bb2c1e0d79ac3c2 (patch)
tree295b4eee204f0d1e4723e62825a86310ddc27578 /Lib/importlib
parentc6b20be85c0de6f2355c67ae6e7e578941275cc0 (diff)
downloadcpython-git-293dd23477eef6e7c1b1e26b5bb2c1e0d79ac3c2.tar.gz
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
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/abc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 4b2d3de6d9..b1b5ccce4b 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -10,7 +10,7 @@ except ImportError as exc:
_frozen_importlib = None
try:
import _frozen_importlib_external
-except ImportError as exc:
+except ImportError:
_frozen_importlib_external = _bootstrap_external
import abc
import warnings