mirror of
https://kkgithub.com/chinese-poetry/chinese-poetry.git
synced 2026-04-09 09:17:30 +00:00
支持打印具体报错详情,文件及内容行数显示
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#! -*- coding: utf-8 -*-
|
#! -*- coding: utf-8 -*-
|
||||||
import os, json, sqlite3
|
import os, json, sqlite3, sys, traceback
|
||||||
|
|
||||||
def check_json(f, _dir):
|
def check_json(f, _dir):
|
||||||
if not f.endswith('.json'):
|
if not f.endswith('.json'):
|
||||||
@@ -11,6 +11,7 @@ def check_json(f, _dir):
|
|||||||
_ = json.loads(file.read())
|
_ = json.loads(file.read())
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
|
sys.stderr.write(traceback.format_exc())
|
||||||
assert False, u"校验(%s)失败" % f
|
assert False, u"校验(%s)失败" % f
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user