From 09b982ede33aefa34e1a25e0bc6e6e9041080aad Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Mon, 31 Jan 2022 14:59:54 -0800 Subject: [PATCH] Fix lint --- staking_deposit/utils/intl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/staking_deposit/utils/intl.py b/staking_deposit/utils/intl.py index 58c2a3b..b92e6a7 100644 --- a/staking_deposit/utils/intl.py +++ b/staking_deposit/utils/intl.py @@ -44,9 +44,11 @@ def load_text(params: List[str], file_path: str='', func: str='', lang: str='') # Auto-detect file-path based on call stack file_path = inspect.stack()[1].filename if file_path[-4:] == '.pyc': - file_path = file_path[:-4] + '.json' # replace .pyc with .json + file_path = file_path[:-4] + '.json' # replace .pyc with .json elif file_path[-3:] == '.py': - file_path = file_path[:-3] + '.json' # replace .py with .json + file_path = file_path[:-3] + '.json' # replace .py with .json + else: + raise KeyError("Wrong file_path %s", file_path) if func == '': # Auto-detect function based on call stack