diff options
author | Kyomotoi <[email protected]> | 2020-11-07 14:49:51 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2020-11-07 14:49:51 +0800 |
commit | c9074b24b98efe18096256ab680535f50691f67d (patch) | |
tree | fb912e4506e478d3d61e89b2824fc83d69eae7cd /api.py | |
parent | 85517a82b9f787ed7c3008655c8dc04d8e6f0a30 (diff) | |
download | ATRI-c9074b24b98efe18096256ab680535f50691f67d.tar.gz ATRI-c9074b24b98efe18096256ab680535f50691f67d.tar.bz2 ATRI-c9074b24b98efe18096256ab680535f50691f67d.zip |
[Upload]
Diffstat (limited to 'api.py')
-rw-r--r-- | api.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -45,7 +45,7 @@ def check_visitors(query: str): Path('.') / 'ATRI' / 'data' / 'data_HTML' / 'api' / 'data' / 'banip' / 'banip.json', 'r') as f: data = json.load(f) - except: + except FileNotFoundError: data = {} if query in data: @@ -147,7 +147,7 @@ async def index(request: Request): Path('.') / 'ATRI' / 'data' / 'data_HTML' / 'api' / 'data' / 'times' / 'api_all.json', 'r') as f: data_all = json.load(f) - except: + except FileNotFoundError: data_all = {} try: @@ -155,7 +155,7 @@ async def index(request: Request): Path('.') / 'ATRI' / 'data' / 'data_HTML' / 'api' / 'data' / 'times' / 'api_index.json', 'r') as f: data_index = json.load(f) - except: + except FileNotFoundError: data_index = {} info = await get_ip_info(ip) @@ -212,7 +212,7 @@ async def get_setu(s_type: str, request: Request): Path('.') / 'ATRI' / 'data' / 'data_HTML' / 'api' / 'data' / 'times' / 'api_all.json', 'r') as f: data_all = json.load(f) - except: + except FileNotFoundError: data_all = {} try: @@ -220,7 +220,7 @@ async def get_setu(s_type: str, request: Request): Path('.') / 'ATRI' / 'data' / 'data_HTML' / 'api' / 'data' / 'times' / 'api_setu.json', 'r') as f: data_setu = json.load(f) - except: + except FileNotFoundError: data_setu = {} info = await get_ip_info(ip) |