From 294b477e95ce05172d4e74e61674333b7722b8f9 Mon Sep 17 00:00:00 2001 From: gleb Date: Tue, 20 Apr 2021 15:59:25 +0300 Subject: [PATCH] refactor changes --- glQiwiApi/types/qiwi_types/polygon.py | 5 +---- glQiwiApi/types/yoomoney_types/types.py | 2 +- glQiwiApi/utils/basics.py | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/glQiwiApi/types/qiwi_types/polygon.py b/glQiwiApi/types/qiwi_types/polygon.py index 5277fcfb..a76ce57f 100644 --- a/glQiwiApi/types/qiwi_types/polygon.py +++ b/glQiwiApi/types/qiwi_types/polygon.py @@ -1,6 +1,3 @@ -from collections import ItemsView - - class Polygon: """ Polygon class for QiwiMaps class """ @@ -19,7 +16,7 @@ def __init__(self, lat_lon_pair_nw: tuple, lat_lon_pair_se: tuple): def dict(self): return {k: str(double) for k, double in self._get_items()} - def _get_items(self) -> ItemsView: + def _get_items(self): return self._dict.items() diff --git a/glQiwiApi/types/yoomoney_types/types.py b/glQiwiApi/types/yoomoney_types/types.py index dbc9238c..333d7c27 100644 --- a/glQiwiApi/types/yoomoney_types/types.py +++ b/glQiwiApi/types/yoomoney_types/types.py @@ -417,7 +417,7 @@ def __repr__(self) -> str: return self.__str__() -class Payment(BaseModel): +class Payment(BaseModel): # lgtm [py/missing-equals # status: str """ Код результата выполнения операции. Возможные значения: diff --git a/glQiwiApi/utils/basics.py b/glQiwiApi/utils/basics.py index 32498def..c0dbfcca 100644 --- a/glQiwiApi/utils/basics.py +++ b/glQiwiApi/utils/basics.py @@ -6,7 +6,6 @@ import warnings from copy import deepcopy from datetime import datetime -from json import JSONDecodeError import pytz from pydantic import ValidationError, BaseModel @@ -215,7 +214,7 @@ def to_datetime(string_representation): {'dt': string_representation} ) return Parser.parse_raw(parsed).dt - except (ValidationError, JSONDecodeError) as ex: + except (ValidationError, orjson.JSONDecodeError) as ex: return ex.json(indent=4)