支持打印具体报错详情,文件及内容行数显示

This commit is contained in:
jackeyGao
2018-08-07 11:59:45 +08:00
parent e7610f394d
commit eb76ac4619

View File

@ -1,5 +1,5 @@
#! -*- coding: utf-8 -*-
import os, json, sqlite3
import os, json, sqlite3, sys, traceback
def check_json(f, _dir):
if not f.endswith('.json'):
@ -11,6 +11,7 @@ def check_json(f, _dir):
_ = json.loads(file.read())
return True
except:
sys.stderr.write(traceback.format_exc())
assert False, u"校验(%s)失败" % f