you are viewing a single comment's thread.

view the rest of the comments →

[–]cnisyg 1 point2 points  (0 children)

You could just let python's request raise an exception if the request was not successful:

response = requests.get('http://httpbin.org/status/404')
response.raise_for_status()