mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +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 logging.handlers
|
||||||
import re
|
import re
|
||||||
import struct
|
import struct
|
||||||
import sys
|
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
@ -392,11 +391,9 @@ class BaseConfigurator(object):
|
||||||
self.importer(used)
|
self.importer(used)
|
||||||
found = getattr(found, frag)
|
found = getattr(found, frag)
|
||||||
return found
|
return found
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
e, tb = sys.exc_info()[1:]
|
|
||||||
v = ValueError('Cannot resolve %r: %s' % (s, e))
|
v = ValueError('Cannot resolve %r: %s' % (s, e))
|
||||||
v.__cause__, v.__traceback__ = e, tb
|
raise v from e
|
||||||
raise v
|
|
||||||
|
|
||||||
def ext_convert(self, value):
|
def ext_convert(self, value):
|
||||||
"""Default converter for the ext:// protocol."""
|
"""Default converter for the ext:// protocol."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue