This commit is contained in:
Hsiao-Wei Wang 2022-01-31 14:59:54 -08:00
parent e1fa8726d0
commit 09b982ede3

View File

@ -47,6 +47,8 @@ def load_text(params: List[str], file_path: str='', func: str='', lang: str='')
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
else:
raise KeyError("Wrong file_path %s", file_path)
if func == '':
# Auto-detect function based on call stack