From a06cdd188dedbd12b1353e52cb2b1fca9be4df75 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Sat, 21 Jul 2018 11:31:18 +0300 Subject: [PATCH] Update json.py fix pyCharm warning 'ujson' in try block with 'except ImportError' should also be defined in except block This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items. --- aiogram/utils/json.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aiogram/utils/json.py b/aiogram/utils/json.py index a5d214d7..4cd02bc6 100644 --- a/aiogram/utils/json.py +++ b/aiogram/utils/json.py @@ -3,11 +3,10 @@ import json try: import ujson - _UJSON_IS_AVAILABLE = True except ImportError: - _UJSON_IS_AVAILABLE = False + ujson = None -_use_ujson = _UJSON_IS_AVAILABLE +_use_ujson = True if ujson else False def disable_ujson():