diff --git a/lyrebird_api_coverage/client/load_base.py b/lyrebird_api_coverage/client/load_base.py index 9eb61d3..c7e29ac 100644 --- a/lyrebird_api_coverage/client/load_base.py +++ b/lyrebird_api_coverage/client/load_base.py @@ -34,10 +34,8 @@ def auto_load_base(): # 通过本地默认base文件获取base elif not os.path.exists(DEFAULT_BASE): copy_file(DEFAULT_BASE) - if not codecs.open(DEFAULT_BASE, 'r', 'utf-8').read(): - get_logger().error('Base is None.Please check your base file of API-Coverage.') - else: - json_obj = json.loads(codecs.open(DEFAULT_BASE, 'r', 'utf-8').read()) + with codecs.open(DEFAULT_BASE, 'r', 'utf-8') as f: + json_obj = json.load(f) app_context.base_sha1 = get_file_sha1(DEFAULT_BASE) return json_obj diff --git a/setup.py b/setup.py index 426a1b8..66c7a9c 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='lyrebird-api-coverage', - version='0.2.3', + version='0.2.4', packages=['lyrebird_api_coverage'], url='https://github.com/meituan/lyrebird-api-coverage', author='HBQA',