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

Revert "remove printing in replace_all_validate"

This reverts commit c3351883ccf7e4deea9508841c02e08b24bd4b8a.
上级 39b6e182
...@@ -208,7 +208,13 @@ class Validator(Feature): ...@@ -208,7 +208,13 @@ class Validator(Feature):
uf = cf.f_back uf = cf.f_back
uf_info = inspect.getframeinfo(uf) uf_info = inspect.getframeinfo(uf)
# Print if verbose, then raise # If the caller is replace_all_validate, just raise the
# exception. replace_all_validate will print out the
# verbose output.
# Or it has to be done here before raise.
if uf_info.function == 'replace_all_validate':
raise
else:
verbose = uf.f_locals.get('verbose', False) verbose = uf.f_locals.get('verbose', False)
if verbose: if verbose:
r = uf.f_locals.get('r', "") r = uf.f_locals.get('r', "")
...@@ -287,6 +293,8 @@ class ReplaceValidate(History, Validator): ...@@ -287,6 +293,8 @@ class ReplaceValidate(History, Validator):
fgraph.validate() fgraph.validate()
except Exception as e: except Exception as e:
fgraph.revert(chk) fgraph.revert(chk)
if verbose:
print("validate failed on node %s.\n Reason: %s, %s" % (r, reason, e))
raise raise
if verbose: if verbose:
print(reason, r, new_r) print(reason, r, new_r)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论