From c9064cb04bece873936ef1e2ab511f0441a8fa01 Mon Sep 17 00:00:00 2001 From: CloudCode Hungary <56896763+cloudcode-hungary@users.noreply.github.com> Date: Wed, 29 Jan 2020 10:39:36 +0100 Subject: [PATCH] handle 202 similar to 204 https://github.com/koalalorenzo/python-digitalocean/issues/305 --- digitalocean/baseapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digitalocean/baseapi.py b/digitalocean/baseapi.py index ef78ea73..e34dbc88 100644 --- a/digitalocean/baseapi.py +++ b/digitalocean/baseapi.py @@ -191,7 +191,7 @@ def get_data(self, url, type=GET, params=None): params.setdefault("per_page", 200) req = self.__perform_request(url, type, params) - if req.status_code == 204: + if req.status_code in (202, 204): return True if req.status_code == 404: