diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-01-10 18:59:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 18:59:21 (GMT) |
commit | 0d639678d33a0f085851a07259b8fe2782943118 (patch) | |
tree | 7729f688de90ee4b3dc19d524115e18d2b92fda5 | |
parent | ec0c392f34ee2474ceacf66881f05546b540e2d1 (diff) | |
download | cpython-0d639678d33a0f085851a07259b8fe2782943118.zip cpython-0d639678d33a0f085851a07259b8fe2782943118.tar.gz cpython-0d639678d33a0f085851a07259b8fe2782943118.tar.bz2 |
bpo-46332: use raise..from instead of assigning __cause__ and raising (GH-30517)
-rw-r--r-- | Lib/logging/config.py | 7 |
1 files 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.""" |