Skip to content

Commit

Permalink
bpo-46332: use raise..from instead of assigning __cause__ and raising (
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Jan 10, 2022
1 parent ec0c392 commit 0d63967
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Lib/logging/config.py
Expand Up @@ -30,7 +30,6 @@
import logging.handlers
import re
import struct
import sys
import threading
import traceback

Expand Down Expand Up @@ -392,11 +391,9 @@ def resolve(self, s):
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."""
Expand Down

0 comments on commit 0d63967

Please sign in to comment.