From c3bca9af486c2c341d2b57ac1d3288d1310bff5d Mon Sep 17 00:00:00 2001 From: Oleg Shlyazhko Date: Sun, 24 Jan 2016 18:28:27 +0300 Subject: [PATCH] remove checking for non 200 http codes, exceptions already handle it --- telegram/utils/botan.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/telegram/utils/botan.py b/telegram/utils/botan.py index 37c8c928f..1c6b774c3 100644 --- a/telegram/utils/botan.py +++ b/telegram/utils/botan.py @@ -43,9 +43,7 @@ class Botan(object): request = Request(url, data=data.encode(), headers={'Content-Type': 'application/json'}) - response = urlopen(request) - if response.getcode() != 200: - return False + urlopen(request) return True except HTTPError as error: self.logger.warn('Botan track error ' + @@ -53,5 +51,5 @@ class Botan(object): ':' + error.read().decode('utf-8')) return False except URLError as error: - self.logger.warn('Botan track error ' + error.reason) + self.logger.warn('Botan track error ' + str(error.reason)) return False