mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46332: use raise..from instead of assigning __cause__ and raising (GH-30517)
This commit is contained in:
parent
ec0c392f34
commit
0d639678d3
1 changed files with 2 additions and 5 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue