From c585c382880f3daab757343801803bbf5049936f Mon Sep 17 00:00:00 2001 From: inpos Date: Sat, 4 Feb 2017 13:31:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20python=202.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon.xml | 1 + lib/vk/api.py | 8 ++++---- lib/vk/exceptions.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addon.xml b/addon.xml index 27a844e..86f0eb2 100644 --- a/addon.xml +++ b/addon.xml @@ -3,6 +3,7 @@ + diff --git a/lib/vk/api.py b/lib/vk/api.py index 043c443..ad14255 100644 --- a/lib/vk/api.py +++ b/lib/vk/api.py @@ -7,12 +7,12 @@ from vk.logs import LOGGING_CONFIG from vk.utils import stringify_values, json_iter_parse, LoggingSession, str_type from vk.exceptions import VkAuthError, VkAPIError from vk.mixins import AuthMixin, InteractiveMixin - +from sys import version_info VERSION = '2.0.2' - -logging.config.dictConfig(LOGGING_CONFIG) +if version_info.major >= 2 and version_info.minor >= 7: # http://xbmc.ru/forum/showpost.php?p=107619&postcount=20 + logging.config.dictConfig(LOGGING_CONFIG) logger = logging.getLogger('vk') @@ -44,7 +44,7 @@ class Session(object): def access_token(self, value): self._access_token = value if isinstance(value, str_type) and len(value) >= 12: - self.censored_access_token = '{}***{}'.format(value[:4], value[-4:]) + self.censored_access_token = '{0}***{1}'.format(value[:4], value[-4:]) # http://xbmc.ru/forum/showpost.php?p=107619&postcount=20 else: self.censored_access_token = value logger.debug('access_token = %r', self.censored_access_token) diff --git a/lib/vk/exceptions.py b/lib/vk/exceptions.py index 55369e6..19987fa 100644 --- a/lib/vk/exceptions.py +++ b/lib/vk/exceptions.py @@ -33,7 +33,7 @@ class VkAPIError(VkException): @staticmethod def get_pretty_request_params(error_data): request_params = error_data.get('request_params', ()) - request_params = {param['key']: param['value'] for param in request_params} + request_params = dict((param['key'], param['value']) for param in request_params) # http://xbmc.ru/forum/showpost.php?p=107615&postcount=16 return request_params def is_access_token_incorrect(self):