Replace with_traceback() with exception chaining and reraising (GH-32074)

This commit is contained in:
Oleg Iarygin 2022-03-30 15:28:20 +03:00 committed by GitHub
parent f08a191882
commit a03a09e068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 12 deletions

View file

@ -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: