Add docstring for monkeypatch_requests.

master
voussoir 2021-10-25 12:29:28 -07:00
parent ba6cb79529
commit 2756fb87e3
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 5 additions and 0 deletions

View File

@ -242,6 +242,11 @@ class HTTP599(HTTP5XX): pass
_requests_raise_for_status = requests.Response.raise_for_status
def monkeypatch_requests():
'''
This function will replace requests.Response.raise_for_status with our
function. You can use this if one of your dependency modules uses requests
and raises HTTPErrors, but you want it to raise these errors instead.
'''
import requests
requests.Response.raise_for_status = raise_for_status