mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Replace with_traceback() with exception chaining and reraising (GH-32074)
This commit is contained in:
parent
f08a191882
commit
a03a09e068
6 changed files with 16 additions and 12 deletions
|
@ -940,10 +940,9 @@ def urlencode(query, doseq=False, safe='', encoding=None, errors=None,
|
|||
# but that's a minor nit. Since the original implementation
|
||||
# allowed empty dicts that type of behavior probably should be
|
||||
# preserved for consistency
|
||||
except TypeError:
|
||||
ty, va, tb = sys.exc_info()
|
||||
except TypeError as err:
|
||||
raise TypeError("not a valid non-string sequence "
|
||||
"or mapping object").with_traceback(tb)
|
||||
"or mapping object") from err
|
||||
|
||||
l = []
|
||||
if not doseq:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue