Use httperrors.

This commit is contained in:
voussoir 2021-11-13 01:21:32 -08:00
parent ef546886c9
commit 3049a62bc0
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -6,6 +6,7 @@ import urllib
from voussoirkit import bytestring
from voussoirkit import dotdict
from voussoirkit import httperrors
from voussoirkit import pathclass
from voussoirkit import pipeable
from voussoirkit import ratelimiter
@ -403,9 +404,9 @@ def request(method, url, headers=None, timeout=TIMEOUT, verify_ssl=True, **kwarg
'post': session.post,
}[method]
req = method(url, headers=headers, timeout=timeout, verify=verify_ssl, **kwargs)
req.raise_for_status()
return req
response = method(url, headers=headers, timeout=timeout, verify=verify_ssl, **kwargs)
httperrors.raise_for_status(response)
return response
def sanitize_filename(text, exclusions=''):
to_remove = FILENAME_BADCHARS