Skip to content

Commit

Permalink
fix file io bug (#8)
Browse files Browse the repository at this point in the history
* fix file io bug

* fix load file io bug
  • Loading branch information
AddisonGao authored Oct 29, 2018
1 parent bb7ddc9 commit afa55a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lyrebird_api_coverage/client/load_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit afa55a4

Please sign in to comment.