提交 e8a8c98c authored 作者: Ziye Fan's avatar Ziye Fan

fix for case that caller of validate_ doesn't have varaible verbose or r

上级 4f035b41
...@@ -215,8 +215,8 @@ class Validator(Feature): ...@@ -215,8 +215,8 @@ class Validator(Feature):
if uf_info.function == 'replace_all_validate': if uf_info.function == 'replace_all_validate':
raise raise
else: else:
verbose = uf.f_locals['verbose'] verbose = uf.f_locals.get('verbose', False)
r = uf.f_locals['r'] r = uf.f_locals.get('r', "")
reason = uf_info.function reason = uf_info.function
if verbose: if verbose:
print("validate failed on node %s.\n Reason: %s, %s" % (r, reason, e)) print("validate failed on node %s.\n Reason: %s, %s" % (r, reason, e))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论