From 0d639678d33a0f085851a07259b8fe2782943118 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:59:21 +0000 Subject: bpo-46332: use raise..from instead of assigning __cause__ and raising (GH-30517) --- Lib/logging/config.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 3bc63b7..9bc07ed 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -30,7 +30,6 @@ import logging import logging.handlers import re import struct -import sys import threading import traceback @@ -392,11 +391,9 @@ class BaseConfigurator(object): self.importer(used) found = getattr(found, frag) return found - except ImportError: - e, tb = sys.exc_info()[1:] + except ImportError as e: v = ValueError('Cannot resolve %r: %s' % (s, e)) - v.__cause__, v.__traceback__ = e, tb - raise v + raise v from e def ext_convert(self, value): """Default converter for the ext:// protocol.""" -- cgit v0.12